using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
using Consign.BizProcess;
using Consign.Entity;
using Item.BizProcess;
using Item.DataLibrary;
using Item.Entity;
using Newtonsoft.Json;
using ShouYang.GetWWUnitInfo;
using ShouYang.WWdata;
using Sybase.DataWindow;

namespace ShouYang;

public class From_ShouYang : Form
{
	public class PublicData_ShouYang
	{
		public int TreeLevel;

		public long Kind_id;

		public long Item_id;

		public long Sample_id;

		public string IndexNo;

		public int MoreSample = 0;

		public string CurrentDwObject = "";

		public string GradeType = "";
	}

	public class Comboadd
	{
		public string name;

		public long id;

		public override string ToString()
		{
			return name;
		}
	}

	private string FirstDwSql = "";

	private int SelectTimes = 0;

	private long FirstSpecid = 0L;

	private long FirstGradeid = 0L;

	private string FirstGroupid = "";

	private ShouYang.GetWWUnitInfo.Unit UnitInfo = new ShouYang.GetWWUnitInfo.Unit();

	private WWData WWdata = new WWData();

	private PublicData_ShouYang Pd = new PublicData_ShouYang();

	private int Result;

	private string ZeroData;

	private string HeTong;

	private string JCDW;

	private IContainer components = null;

	private GroupBox groupBox2;

	private CheckedListBox List_Xiangmu;

	private GroupBox groupBox4;

	private GroupBox groupBox5;

	private GroupBox groupBox6;

	private DataGridView DBG_SampleTemp;

	private TreeView TV_Sample;

	private ImageList imageList1;

	private Label label19;

	private Label label20;

	private TextBox Text_ChengJieRen;

	private Label label23;

	private TextBox Text_QuBaoGaoShuoMing;

	private Label label25;

	private Label label24;

	private ComboBox Combo_QuBaoGaoFangShi;

	private Button Btn_Submit;

	private Button Btn_Exit;

	private Button Btn_AddSample;

	private Button Btn_RemoveSample;

	private TextBox Text_ZhuShu;

	private Label label26;

	private Label label27;

	private ComboBox Combo_SongYangRenBianHao;

	private Button Btn_ModifyWeituo;

	private DataWindowControl dw_1;

	private TextBox Text_DaiBiaoShuLiang;

	private Label label30;

	private DateTimePicker DTP_GetSampleDate;

	private DateTimePicker DTP_SendSampleDate;

	private Label label22;

	private Label label21;

	private GroupBox groupBox7;

	private System.Windows.Forms.CheckBox Cb_QuBaoGao;

	private System.Windows.Forms.CheckBox Cb_LiuZhuan;

	private DataGridViewTextBoxColumn ID;

	private DataGridViewTextBoxColumn IndexNo;

	private DataGridViewTextBoxColumn SampleName;

	private DataGridViewTextBoxColumn SpecName;

	private DataGridViewTextBoxColumn Exam_Parameter_CN;

	private DataGridViewTextBoxColumn ProJect_Part;

	private DataGridViewTextBoxColumn Exam_Quan;

	private DataGridViewTextBoxColumn ProJect_Name;

	private DataGridViewTextBoxColumn ProJect_Name_Addon;

	private DataGridViewTextBoxColumn Deliver_Date;

	private DataGridViewTextBoxColumn Sampling_Date;

	private DataGridViewTextBoxColumn Exam_Kind;

	private DataGridViewTextBoxColumn Project_ID;

	private DataGridViewTextBoxColumn Record_Certificate;

	private DataGridViewTextBoxColumn Total_Prices;

	private DataGridViewTextBoxColumn Area_ID;

	private DataGridViewTextBoxColumn Witness_No;

	private DataGridViewTextBoxColumn Sampling_No;

	private DataGridViewTextBoxColumn Sending_No;

	private DataGridViewTextBoxColumn Carryon_Person;

	private DataGridViewTextBoxColumn GetReport_Type;

	private DataGridViewTextBoxColumn GetReport_Memo;

	private DataGridViewTextBoxColumn Memo;

	private DataGridViewTextBoxColumn Exam_Info;

	private DataGridViewTextBoxColumn KindID;

	private DataGridViewTextBoxColumn ItemID;

	private DataGridViewTextBoxColumn GradeID;

	private DataGridViewTextBoxColumn Exam_Result;

	private DataGridViewTextBoxColumn Status;

	private DataGridViewTextBoxColumn Steps;

	private DataGridViewTextBoxColumn Prince;

	private DataGridViewTextBoxColumn Molding_Date;

	private DataGridViewTextBoxColumn Delegate_Quan;

	private DataGridViewTextBoxColumn Uc_index;

	private DataWindowControl Dw_2;

	private Button Btn_DownLoad;

	private ComboBox Combo_Unit;

	private Label label33;

	private DataWindowControl dw_Witness;

	private DataWindowControl dw_GetSample;

	private GroupBox groupBox8;

	private Label label34;

	private PictureBox pictureBox1;

	private Button button1;

	private Label Lb_ReExam;

	private DataWindowControl dw_OldSampleId;

	private System.Windows.Forms.RadioButton Rb_Default;

	private System.Windows.Forms.RadioButton Rb_LianXu;

	private ComboBox Combo_JYXZ;

	private Label label1;

	private DataWindowControl Dw_Import;

	private TextBox Text_LiuZhuang;

	private Label label32;

	private TextBox Text_BeiZhu;

	private Label label28;

	private GroupBox groupBox1;

	private Label label29;

	private Label label5;

	private ComboBox Combo_Guige;

	private ComboBox Combo_YPMC;

	private Label label4;

	private ComboBox Combo_YPLB;

	private Label label3;

	private ComboBox Combo_JCLX;

	private Label label2;

	private ComboBox Combo_QiangDuDengJi;

	private Button Btn_Sort;

	private System.Windows.Forms.CheckBox Cb_Year;

	private System.Windows.Forms.CheckBox Cb_ShowFinish;

	private DataWindowControl dw_WWJcdw;

	private Label label7;

	private Label label6;

	private ComboBox Cb_Reason;

	private Label label8;

	public From_ShouYang()
	{
		InitializeComponent();
	}

	private void SetDwColor(DataWindowControl dw)
	{
		string text = "";
		string text2 = "";
		string text3 = "";
		string text4 = "";
		int num = 0;
		dw.Modify("DataWindow.Grid.ColumnMove = No");
		dw.Modify("DataWindow.Selected.Mouse = No");
		text4 = dw.Describe("DataWindow.Objects").Trim() + "\t";
		while (text4.IndexOf('\t') > 0)
		{
			num = text4.IndexOf('\t');
			text2 = text4.Substring(0, num);
			text = dw.Describe(text2 + ".Band");
			if (text == "detail")
			{
				dw.Modify(text2 + ".Background.Mode='0'");
				dw.Modify(text2 + ".Background.Color = '16777215~tIf(GetRow() = CurrentRow(),16770740,If(Mod(GetRow(),2) = 0,15792895,15792880))'");
			}
			text4 = text4.Substring(num + 1, text4.Length - (num + 1));
		}
	}

	private void SetGangJinShuLiang()
	{
		if (!(dw_1.DataWindowObject == "d_sampleuc_gangjin"))
		{
			return;
		}
		DataStore dataStore = new DataStore();
		dataStore.LibraryList = "scetia.pbl";
		dataStore.DataWindowObject = "d_standard_gj";
		SqlConnection sqlConnection = CreateConnection();
		sqlConnection.Open();
		AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
		adoTransaction.BindConnection();
		dataStore.SetTransaction(adoTransaction);
		dataStore.Retrieve(Pd.Sample_id, (int)GetGuiGeIdByName(Combo_Guige.Text, Pd.Sample_id), (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id));
		int num = 0;
		double num2 = 0.0;
		int num3 = 0;
		if (Combo_YPMC.Text == "" || (Combo_Guige.Text == "" && Combo_Guige.Items.Count > 0) || (Combo_QiangDuDengJi.Text == "" && Combo_QiangDuDengJi.Items.Count > 0))
		{
			return;
		}
		if (dataStore.RowCount > 0)
		{
			try
			{
				num3 = (int)dataStore.GetItemDecimal(1, "BendingNumber");
				num = (int)dataStore.GetItemDecimal(1, "tensilenumber");
			}
			catch
			{
			}
		}
		dw_1.SetItemDecimal(dw_1.CurrentRow, "JianCeShuLiang", num);
		dw_1.SetItemDecimal(dw_1.CurrentRow, "gj_wanqushuliang", num3);
		adoTransaction.UnbindConnection();
		sqlConnection.Close();
	}

	private void SetID()
	{
		int num = 0;
		int num2 = 0;
		DataStore dataStore = new DataStore();
		Dw_Public.GetData_Ds(dataStore, "d_modify_currentnewid");
		DataStore dataStore2 = new DataStore();
		Dw_Public.GetData_Ds(dataStore2, "d_jbzitem_child");
		for (num2 = 12; num2 <= 30; num2++)
		{
			string text = num2.ToString();
			for (num = 1; num <= dataStore2.RowCount; num++)
			{
				long num3 = (long)dataStore2.GetItemDecimal(num, "itemid");
				long num4 = dataStore.FindRow("itemid=" + num3 + " and yearstr='" + text + "'", 1, dataStore.RowCount);
				if (num4 <= 0)
				{
					dataStore.InsertRow(0);
					dataStore.SetItemString(dataStore.RowCount, "yearstr", text);
					dataStore.SetItemDecimal(dataStore.RowCount, "itemid", num3);
					dataStore.SetItemString(dataStore.RowCount, "currentconsignid", "000001");
					dataStore.SetItemString(dataStore.RowCount, "currentsampleid", "000001");
				}
			}
		}
		try
		{
			using SqlConnection sqlConnection = CreateConnection();
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			dataStore.SetTransaction(adoTransaction);
			try
			{
				dataStore.UpdateData();
			}
			catch (DbErrorException ex)
			{
				MessageBox.Show("更新不成功！原因：" + ex.SqlErrorText);
			}
			catch (DataWindowNotCreatedException)
			{
				MessageBox.Show("数据窗口还没有创建！");
			}
			catch (MethodFailureException ex3)
			{
				MessageBox.Show("更新不成功！原因：" + ex3.Message.ToString());
			}
			catch
			{
				MessageBox.Show("更新不成功,请检查网络！");
			}
		}
		catch
		{
		}
	}

	private void Form1_Load(object sender, EventArgs e)
	{
		SetID();
		NewWeituo();
		CreateTv(11, 0);
		Combo_JYXZ.Text = "取样";
		Combo_QuBaoGaoFangShi.Text = "自取";
		TV_Sample.Nodes[0].Expand();
	}

	private static SqlConnection CreateConnection()
	{
		string connectionString = ConfigurationManager.ConnectionStrings["Consign"].ConnectionString;
		return new SqlConnection(connectionString);
	}

	private bool ExcuteFunctionByFunctionName(string m_functionName)
	{
		bool result = false;
		object currencyObject = Public_Data.CurrencyObject;
		try
		{
			Type type = Public_Data.CurrencyObject.GetType();
			MemberInfo[] array = type.FindMembers(MemberTypes.Method, BindingFlags.Instance | BindingFlags.Public, null, null);
			MemberInfo[] array2 = array;
			foreach (MemberInfo memberInfo in array2)
			{
				if (memberInfo.Name == m_functionName)
				{
					result = (bool)type.InvokeMember(memberInfo.Name, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, currencyObject, null);
					return result;
				}
			}
		}
		catch
		{
		}
		return result;
	}

	public void SetLock()
	{
	}

	private long GetCanShuIdByName(string Name, long YPMCID)
	{
		long result = 0L;
		ParameterBizProcess parameterBizProcess = new ParameterBizProcess();
		List<ParameterEntity> list = new List<ParameterEntity>();
		list = parameterBizProcess.GetAll("", "ParameterName='" + Name + "' and SampleID=" + YPMCID, "");
		foreach (ParameterEntity item in list)
		{
			result = item.ParameterID;
		}
		return result;
	}

	private float GetCanShuFeiYongByName(string Name, long YPMCID)
	{
		float result = 0f;
		ParameterBizProcess parameterBizProcess = new ParameterBizProcess();
		List<ParameterEntity> list = new List<ParameterEntity>();
		list = parameterBizProcess.GetAll("", "ParameterName='" + Name + "' and SampleID=" + YPMCID, "");
		foreach (ParameterEntity item in list)
		{
			if (!item.TestFee.HasValue)
			{
				continue;
			}
			if (item.TestFee == -1.0)
			{
				using SqlConnection sqlConnection = CreateConnection();
				long num = 0L;
				long num2 = 0L;
				num = GetGuiGeIdByName(Combo_Guige.Text, YPMCID);
				num2 = GetGradeIdByName(Combo_QiangDuDengJi.Text, YPMCID);
				DataStore dataStore = new DataStore();
				dataStore.LibraryList = "scetia.pbl";
				dataStore.DataWindowObject = "d_testfee_find";
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				dataStore.SetTransaction(adoTransaction);
				dataStore.Retrieve(GetCanShuIdByName(Name, YPMCID), num, num2);
				if (dataStore.RowCount == 0)
				{
					dataStore.Retrieve(GetCanShuIdByName(Name, YPMCID), 0, num2);
				}
				if (dataStore.RowCount == 0)
				{
					dataStore.Retrieve(GetCanShuIdByName(Name, YPMCID), num, 0);
				}
				result = ((dataStore.RowCount <= 0) ? (-1f) : ((float)dataStore.GetItemDecimal(1, "testfee")));
			}
			else
			{
				result = (float)item.TestFee.Value;
			}
		}
		return result;
	}

	private long GetKindIdByName(string Name)
	{
		long result = 0L;
		KindBizProcess kindBizProcess = new KindBizProcess();
		List<KindEntity> list = new List<KindEntity>();
		list = kindBizProcess.GetAll("", "KindName='" + Name + "'", "");
		foreach (KindEntity item in list)
		{
			result = item.KindID;
		}
		return result;
	}

	private long GetItemIdByName(string Name, long KindId)
	{
		long result = 0L;
		ItemBizProcess itemBizProcess = new ItemBizProcess();
		List<ItemEntity> list = new List<ItemEntity>();
		list = itemBizProcess.GetAll("", "ItemName='" + Name + "' and KindID=" + KindId, "");
		foreach (ItemEntity item in list)
		{
			result = item.ItemID;
		}
		return result;
	}

	private long GetSampleIdByName(string Name, long ItemId)
	{
		long result = 0L;
		Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
		List<Item.Entity.SampleEntity> list = new List<Item.Entity.SampleEntity>();
		list = sampleBizProcess.GetAll("", "SampleName='" + Name + "' and ItemID=" + ItemId, "");
		foreach (Item.Entity.SampleEntity item in list)
		{
			result = item.SampleID;
		}
		return result;
	}

	private string GetGuiGeNameById(long SpecId, long SampleId)
	{
		string result = "";
		SpecBizProcess specBizProcess = new SpecBizProcess();
		List<SpecEntity> list = new List<SpecEntity>();
		list = specBizProcess.GetAll("", "SpecId='" + SpecId + "' and SampleID=" + SampleId, "");
		foreach (SpecEntity item in list)
		{
			result = item.SpecName;
		}
		return result;
	}

	private string GetGradeNameById(long GradeId, long SampleId)
	{
		string result = "";
		GradeBizProcess gradeBizProcess = new GradeBizProcess();
		List<GradeEntity> list = new List<GradeEntity>();
		list = gradeBizProcess.GetAll("", "GradeID='" + GradeId + "' and SampleID=" + SampleId, "");
		foreach (GradeEntity item in list)
		{
			result = item.GradeName;
		}
		return result;
	}

	private long GetGuiGeIdByName(string Name, long SampleId)
	{
		long result = 0L;
		SpecBizProcess specBizProcess = new SpecBizProcess();
		List<SpecEntity> list = new List<SpecEntity>();
		list = specBizProcess.GetAll("", "SpecName='" + Name + "' and SampleID=" + SampleId, "");
		foreach (SpecEntity item in list)
		{
			result = item.SpecID;
		}
		return result;
	}

	private long GetGradeIdByName(string Name, long SampleId)
	{
		long result = 0L;
		GradeBizProcess gradeBizProcess = new GradeBizProcess();
		List<GradeEntity> list = new List<GradeEntity>();
		list = gradeBizProcess.GetAll("", "GradeName='" + Name + "' and SampleID=" + SampleId, "");
		foreach (GradeEntity item in list)
		{
			result = item.GradeID;
		}
		return result;
	}

	private void CreateTv(int Kind, int type)
	{
		int num = 0;
		int num2 = 0;
		TV_Sample.Nodes.Clear();
		DataStore dataStore = new DataStore();
		Dw_Public.GetData_Ds(dataStore, "d_jbzkind_dis");
		if (Kind != 0)
		{
			dataStore.SetFilter("kindid=" + Kind);
			dataStore.Filter();
		}
		for (num = 1; num <= dataStore.RowCount; num++)
		{
			long num3 = (long)dataStore.GetItemDecimal(num, "kindid");
			string itemString = dataStore.GetItemString(num, "kindname");
			TreeNode treeNode = new TreeNode();
			treeNode.ImageIndex = 0;
			treeNode.SelectedImageIndex = 3;
			treeNode.Tag = num3;
			treeNode.Text = itemString;
			TV_Sample.Nodes.Add(treeNode);
			DataStore dataStore2 = new DataStore();
			Dw_Public.GetData_Ds(dataStore2, "d_jbzkind");
			dataStore2.SetFilter("kindid=" + num3);
			dataStore2.Filter();
			for (num2 = 1; num2 <= dataStore2.RowCount; num2++)
			{
				long num4 = (long)dataStore2.GetItemDecimal(num2, "ItemID");
				string itemString2 = dataStore2.GetItemString(num2, "item_item_itemname");
				TreeNode treeNode2 = new TreeNode();
				treeNode2.ImageIndex = 1;
				treeNode2.SelectedImageIndex = 4;
				treeNode2.Tag = num4;
				treeNode2.Text = itemString2;
				treeNode.Nodes.Add(treeNode2);
				Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
				List<Item.Entity.SampleEntity> list = new List<Item.Entity.SampleEntity>();
				list = ((type != 0) ? sampleBizProcess.GetAll("", "ItemID=" + num4 + " and CanConsign>0", "") : sampleBizProcess.GetAll("", "ItemID=" + num4 + " and CanConsign=1", ""));
				foreach (Item.Entity.SampleEntity item in list)
				{
					long num5 = item.SampleID;
					string text = item.SampleName + "(" + item.SampleJudge + ")";
					TreeNode treeNode3 = new TreeNode();
					treeNode3.ImageIndex = 2;
					treeNode3.SelectedImageIndex = 5;
					treeNode3.Tag = num5;
					treeNode3.Text = text;
					treeNode2.Nodes.Add(treeNode3);
				}
			}
		}
	}

	private void DeleteYPTemp(string IndexNo)
	{
		SampleTempBizProcess sampleTempBizProcess = new SampleTempBizProcess();
		List<SampleTempEntity> list = new List<SampleTempEntity>();
		list = sampleTempBizProcess.GetAll("", "IndexNo='" + IndexNo + "'", "");
		foreach (SampleTempEntity item in list)
		{
			sampleTempBizProcess.Delete(item);
		}
		list = sampleTempBizProcess.GetAll("", "IndexNo='" + IndexNo + "'", "");
		DBG_SampleTemp.DataSource = list;
	}

	private void DeleteYPTemp()
	{
		SampleTempBizProcess sampleTempBizProcess = new SampleTempBizProcess();
		List<SampleTempEntity> list = new List<SampleTempEntity>();
		list = sampleTempBizProcess.GetAll("", "", "");
		foreach (SampleTempEntity item in list)
		{
			sampleTempBizProcess.Delete(item);
		}
	}

	private void NewWeituo()
	{
		TV_Sample.CollapseAll();
		List_Xiangmu.Items.Clear();
		Combo_Guige.Items.Clear();
		Combo_JYXZ.Text = "送样";
		Combo_JCLX.Text = "";
		Combo_YPLB.Text = "";
		Combo_YPMC.Text = "";
		Combo_Guige.Items.Clear();
		Combo_Guige.Text = "";
		Text_ZhuShu.Text = "1";
		Text_ChengJieRen.Text = "";
		Text_BeiZhu.Text = "";
		Combo_SongYangRenBianHao.Items.Clear();
		Combo_SongYangRenBianHao.Text = "";
		DTP_SendSampleDate.Value = DateTime.Now.ToLocalTime();
		DTP_GetSampleDate.Value = DateTime.Now.ToLocalTime();
		Combo_QuBaoGaoFangShi.Text = "";
		Text_QuBaoGaoShuoMing.Text = "";
		Text_DaiBiaoShuLiang.Text = "";
		Text_LiuZhuang.Text = "";
		if (DBG_SampleTemp.RowCount > 0)
		{
			DeleteYPTemp(DBG_SampleTemp.CurrentRow.Cells["IndexNo"].Value.ToString());
		}
		Combo_QiangDuDengJi.Items.Clear();
		Text_DaiBiaoShuLiang.Text = "";
		Pd.CurrentDwObject = "";
		Pd.IndexNo = "";
		Pd.Item_id = 0L;
		Pd.Kind_id = 0L;
		Pd.MoreSample = 0;
		Pd.Sample_id = 0L;
		Pd.TreeLevel = 0;
		Pd.GradeType = "";
		if (dw_Witness.DataWindowObject != "")
		{
			dw_Witness.Reset();
		}
		if (dw_GetSample.DataWindowObject != "")
		{
			dw_GetSample.Reset();
		}
		Public_Data.WithnessName = "";
		Public_Data.GetsampleName = "";
		SelectTimes = 0;
	}

	private void button1_Click(object sender, EventArgs e)
	{
	}

	private void Combo_JCLX_SelectedIndexChanged(object sender, EventArgs e)
	{
		Combo_YPLB.Items.Clear();
		object selectedItem = Combo_JCLX.SelectedItem;
		long id = ((Comboadd)selectedItem).id;
		ItemBizProcess itemBizProcess = new ItemBizProcess();
		List<ItemEntity> list = new List<ItemEntity>();
		list = itemBizProcess.GetAll("", " KindID=" + id, "");
		foreach (ItemEntity item in list)
		{
			long id2 = item.ItemID;
			string name = item.ItemName.ToString();
			Comboadd comboadd = new Comboadd();
			comboadd.id = id2;
			comboadd.name = name;
			Combo_YPLB.Items.Add(comboadd);
		}
	}

	private void Combo_YPLB_SelectedIndexChanged(object sender, EventArgs e)
	{
		Combo_YPMC.Items.Clear();
		object selectedItem = Combo_YPLB.SelectedItem;
		long id = ((Comboadd)selectedItem).id;
		Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
		List<Item.Entity.SampleEntity> list = new List<Item.Entity.SampleEntity>();
		list = sampleBizProcess.GetAll("", "ItemID=" + id + " and CanConsign=1", "");
		foreach (Item.Entity.SampleEntity item in list)
		{
			long id2 = item.SampleID;
			string sampleName = item.SampleName;
			Comboadd comboadd = new Comboadd();
			comboadd.id = id2;
			comboadd.name = sampleName;
			Combo_YPMC.Items.Add(comboadd);
		}
	}

	private void Combo_YPMC_SelectedIndexChanged(object sender, EventArgs e)
	{
		List_Xiangmu.Items.Clear();
		Combo_Guige.Items.Clear();
		object selectedItem = Combo_YPMC.SelectedItem;
		long id = ((Comboadd)selectedItem).id;
		long id2 = ((Comboadd)selectedItem).id;
		ParameterBizProcess parameterBizProcess = new ParameterBizProcess();
		List<ParameterEntity> list = new List<ParameterEntity>();
		list = parameterBizProcess.GetAll("", "SampleID=" + id + " CanConsign=1", "");
		foreach (ParameterEntity item in list)
		{
			long id3 = item.ParameterID;
			string parameterName = item.ParameterName;
			Comboadd comboadd = new Comboadd();
			comboadd.id = id3;
			comboadd.name = parameterName;
			List_Xiangmu.Items.Add(comboadd);
		}
		SpecBizProcess specBizProcess = new SpecBizProcess();
		List<SpecEntity> list2 = new List<SpecEntity>();
		list2 = specBizProcess.GetAll("", "SampleID=" + id, "");
		foreach (SpecEntity item2 in list2)
		{
			long id4 = item2.SpecID;
			string specName = item2.SpecName;
			Comboadd comboadd = new Comboadd();
			comboadd.id = id4;
			comboadd.name = specName;
			Combo_Guige.Items.Add(comboadd);
		}
	}

	private void GetImportData(int type, long SampleId)
	{
		Dw_Import.LibraryList = "scetia.pbl";
		try
		{
			using SqlConnection sqlConnection = CreateConnection();
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			if (type == 0)
			{
				Dw_Import.DataWindowObject = "d_import_list";
				Dw_Import.SetTransaction(adoTransaction);
				Dw_Import.Retrieve();
				Dw_Import.Modify("checkflag.visible=false");
			}
			if (type == 1)
			{
				Dw_Import.DataWindowObject = "d_import_retrieve_kind";
				Dw_Import.SetTransaction(adoTransaction);
				Dw_Import.Retrieve(SampleId);
				Dw_Import.Modify("checkflag.visible=false");
			}
			if (type == 2)
			{
				Dw_Import.DataWindowObject = "d_import_retrieve_item";
				Dw_Import.SetTransaction(adoTransaction);
				Dw_Import.Retrieve(SampleId);
				Dw_Import.Modify("checkflag.visible=false");
			}
			if (type == 3)
			{
				Dw_Import.DataWindowObject = "d_import_retrieve";
				Dw_Import.SetTransaction(adoTransaction);
				Dw_Import.Retrieve(SampleId);
			}
			string text = "";
			if (Cb_ShowFinish.Checked)
			{
				if (Cb_Year.Checked)
				{
					text = " year(import_date)=" + DateTime.Today.Year;
					Dw_Import.SetFilter("sampling=0 and finish=0 and " + text);
				}
				else
				{
					Dw_Import.SetFilter("sampling=0 and finish=0");
				}
				Dw_Import.Filter();
			}
			else
			{
				if (Cb_Year.Checked)
				{
					text = " year(import_date)=" + DateTime.Today.Year;
					Dw_Import.SetFilter(text + " and finish=0");
				}
				else
				{
					Dw_Import.SetFilter("");
				}
				Dw_Import.Filter();
			}
			if (Dw_Import.RowCount > 0)
			{
				Dw_Import.Focus();
				SendKeys.Send("{tab}");
			}
			Dw_Import.SetRedrawOff();
			SetDwColor(Dw_Import);
			Dw_Import.SetRedrawOn();
			Dw_Import.Refresh();
			sqlConnection.Close();
		}
		catch
		{
		}
	}

	private void TV_Sample_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
	{
		int num = 0;
		int num2 = 0;
		string text = "";
		Pd.GradeType = "";
		if (DBG_SampleTemp.RowCount > 0)
		{
			if (e.Node.ImageIndex == 0 && e.Node.Text != Combo_JCLX.Text)
			{
				MessageBox.Show("你已经使用了多组收样，多组收样不可收多种材料大类!");
				return;
			}
			if (e.Node.ImageIndex == 1 && e.Node.Text != Combo_YPLB.Text)
			{
				MessageBox.Show("你已经使用了多组收样，多组收样不可收多种材料大类!");
				return;
			}
			if (e.Node.ImageIndex == 2 && e.Node.Parent.Text != Combo_YPLB.Text)
			{
				MessageBox.Show("你已经使用了多组收样，多组收样不可收多种材料大类!");
				return;
			}
		}
		Pd.TreeLevel = e.Node.ImageIndex;
		SelectTimes = 0;
		FirstSpecid = 0L;
		FirstGradeid = 0L;
		FirstGroupid = "";
		Combo_Guige.Text = "";
		Combo_QiangDuDengJi.Text = "";
		switch (Pd.TreeLevel)
		{
		case 0:
			Combo_JCLX.Text = e.Node.Text;
			Pd.Kind_id = (long)e.Node.Tag;
			Combo_YPLB.Text = "";
			Combo_YPMC.Text = "";
			GetImportData(1, Pd.Kind_id);
			break;
		case 1:
		{
			if (e.Node.Text != Combo_YPLB.Text && dw_1.DataWindowObject != "")
			{
				dw_1.Reset();
				dw_1.DataWindowObject = "";
			}
			Combo_YPLB.Text = e.Node.Text;
			Combo_JCLX.Text = e.Node.Parent.Text;
			Pd.Kind_id = (long)e.Node.Parent.Tag;
			Pd.Item_id = (long)e.Node.Tag;
			Combo_YPMC.Text = "";
			Combo_QiangDuDengJi.Items.Clear();
			Combo_Guige.Items.Clear();
			GetImportData(2, Pd.Item_id);
			dw_1.LibraryList = "scetia.pbl";
			using SqlConnection sqlConnection = CreateConnection();
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			ItemBizProcess itemBizProcess = new ItemBizProcess();
			List<ItemEntity> list5 = new List<ItemEntity>();
			list5 = itemBizProcess.GetAll("", "ItemID=" + e.Node.Tag.ToString(), "");
			foreach (ItemEntity item in list5)
			{
			}
			DataStore dataStore3 = new DataStore();
			dataStore3.LibraryList = "scetia.pbl";
			dataStore3.DataWindowObject = "d_productionunittype";
			dataStore3.SetTransaction(adoTransaction);
			dataStore3.Retrieve(Pd.Sample_id);
			if (Combo_JYXZ.Text == "复验")
			{
				dw_OldSampleId.Enabled = true;
				Lb_ReExam.Enabled = true;
				if (Pd.Item_id != 0)
				{
					dw_OldSampleId.LibraryList = "scetia.pbl";
					dw_OldSampleId.DataWindowObject = "d_retest_sampleid_dp";
					dw_OldSampleId.SetTransaction(adoTransaction);
					DataWindowChild child4 = dw_OldSampleId.GetChild("sample_id");
					child4.SetTransaction(adoTransaction);
					child4.Reset();
					child4.Retrieve(Pd.Item_id);
					if (child4.RowCount > 0)
					{
						dw_OldSampleId.Retrieve(Pd.Item_id);
					}
					else
					{
						dw_OldSampleId.Reset();
					}
				}
			}
			sqlConnection.Close();
			break;
		}
		case 2:
		{
			if (e.Node.Parent.Text != Combo_YPLB.Text && dw_1.DataWindowObject != "")
			{
				dw_1.Reset();
				dw_1.DataWindowObject = "";
			}
			Combo_YPMC.Text = e.Node.Text;
			Combo_YPLB.Text = e.Node.Parent.Text;
			Combo_JCLX.Text = e.Node.Parent.Parent.Text;
			Pd.Kind_id = (long)e.Node.Parent.Parent.Tag;
			Pd.Item_id = (long)e.Node.Parent.Tag;
			Pd.Sample_id = (long)e.Node.Tag;
			Pd.GradeType = "";
			if (Combo_JYXZ.Text == "外委")
			{
				string message = "";
				byte[] detectionUnitInfoForInWW = UnitInfo.GetDetectionUnitInfoForInWW(UserOfClientPart.userName, UserOfClientPart.userPwd, Pd.Sample_id.ToString(), out message);
				Stream serializationStream = new MemoryStream(detectionUnitInfoForInWW);
				BinaryFormatter binaryFormatter = new BinaryFormatter();
				DataTable dataTable = (DataTable)binaryFormatter.Deserialize(serializationStream);
				dw_WWJcdw.LibraryList = "scetia.pbl";
				dw_WWJcdw.DataWindowObject = "d_ww_unitname_dp";
				dw_WWJcdw.Retrieve(dataTable);
				DataWindowChild child = dw_WWJcdw.GetChild("membercode");
				child.Retrieve(dataTable);
				dw_WWJcdw.Enabled = true;
			}
			GetImportData(3, Pd.Sample_id);
			if (Dw_Import.RowCount > 0)
			{
				Dw_Import.SelectRow(1, Select: false);
				Combo_Guige.Text = GetGuiGeNameById((long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid"), Pd.Sample_id);
				Combo_QiangDuDengJi.Text = GetGradeNameById((long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid"), Pd.Sample_id);
			}
			Combo_Guige.Items.Clear();
			SpecBizProcess specBizProcess = new SpecBizProcess();
			List<SpecEntity> list = new List<SpecEntity>();
			list = specBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
			foreach (SpecEntity item2 in list)
			{
				Comboadd comboadd = new Comboadd();
				comboadd.id = item2.SpecID;
				comboadd.name = item2.SpecName;
				Combo_Guige.Items.Add(comboadd);
			}
			Combo_QiangDuDengJi.Items.Clear();
			GradeBizProcess gradeBizProcess = new GradeBizProcess();
			List<GradeEntity> list2 = new List<GradeEntity>();
			list2 = gradeBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
			foreach (GradeEntity item3 in list2)
			{
				if (item3.GradeType == "" || item3.GradeType == "强度")
				{
					Comboadd comboadd = new Comboadd();
					comboadd.id = item3.GradeID;
					comboadd.name = item3.GradeName;
					Combo_QiangDuDengJi.Items.Add(comboadd);
				}
				if (item3.GradeType != "" || item3.GradeType != null)
				{
					if (Pd.GradeType == "" && item3.GradeType != "强度")
					{
						Pd.GradeType = item3.GradeType;
					}
					if (Pd.GradeType == "密度" && item3.GradeType == "外观")
					{
						Pd.GradeType = "密度,外观";
					}
					if (Pd.GradeType == "外观" && item3.GradeType == "密度")
					{
						Pd.GradeType = "密度,外观";
					}
				}
				else
				{
					Pd.GradeType = "";
				}
			}
			List_Xiangmu.Items.Clear();
			ParameterBizProcess parameterBizProcess = new ParameterBizProcess();
			List<ParameterEntity> list3 = new List<ParameterEntity>();
			list3 = ((!(Combo_JYXZ.Text == "外委")) ? parameterBizProcess.GetAll("", string.Concat("SampleID=", e.Node.Tag, " and CanConsign=1"), "ParameterID asc") : parameterBizProcess.GetAll("", string.Concat("SampleID=", e.Node.Tag, " and CanConsign>0"), "ParameterID asc"));
			foreach (ParameterEntity item4 in list3)
			{
				long id = item4.ParameterID;
				string parameterName = item4.ParameterName;
				bool value = item4.IsDefault.Value;
				Comboadd comboadd = new Comboadd();
				comboadd.id = id;
				comboadd.name = parameterName;
				List_Xiangmu.Items.Add(comboadd);
				if (value)
				{
					List_Xiangmu.SetItemChecked(List_Xiangmu.Items.Count - 1, value: true);
				}
			}
			int num3 = 0;
			int num4 = 0;
			int num5 = 0;
			if (dw_1.DataWindowObject == "" || dw_1.DataWindowObject == null)
			{
				dw_1.LibraryList = "scetia.pbl";
				using SqlConnection sqlConnection = CreateConnection();
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				DataStore dataStore = new DataStore();
				dataStore.LibraryList = "scetia.pbl";
				dataStore.DataWindowObject = "d_samplename_child_find";
				dataStore.SetTransaction(adoTransaction);
				dataStore.Retrieve(Pd.Sample_id);
				if (dataStore.RowCount > 0)
				{
					dw_1.DataWindowObject = dataStore.GetItemString(1, "sampleuc");
					Pd.CurrentDwObject = dataStore.GetItemString(1, "sampleuc");
					if (dw_1.DataWindowObject == "" || dw_1.DataWindowObject == null)
					{
						dw_1.DataWindowObject = "d_sampleuc_default";
						Pd.CurrentDwObject = "d_sampleuc_default";
						dw_1.SetTransaction(adoTransaction);
						if (dw_1.RowCount <= 0)
						{
							dw_1.InsertRow(0);
						}
					}
					dw_1.SetTransaction(adoTransaction);
					try
					{
						dw_1.SetColumn("product_symbol");
					}
					catch
					{
					}
					if (dw_1.GetColumnName() == "product_symbol")
					{
						string stringValue = "";
						Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
						List<Item.Entity.SampleEntity> list4 = new List<Item.Entity.SampleEntity>();
						list4 = sampleBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
						foreach (Item.Entity.SampleEntity item5 in list4)
						{
							stringValue = item5.SampleSymbol;
						}
						dw_1.SetItemString(dw_1.CurrentRow, "product_symbol", stringValue);
					}
					try
					{
						DataWindowChild child2 = dw_1.GetChild("hntks_gradeid");
						child2.SetTransaction(adoTransaction);
						child2.Retrieve(Pd.Sample_id);
					}
					catch
					{
					}
					try
					{
						DataWindowChild child3 = dw_1.GetChild("tijimidujibie");
						child3.SetTransaction(adoTransaction);
						child3.Retrieve(Pd.Sample_id);
					}
					catch
					{
					}
					if (Combo_JYXZ.Text == "复验")
					{
						dw_OldSampleId.Enabled = true;
						Lb_ReExam.Enabled = true;
						if (Pd.Item_id != 0)
						{
							dw_OldSampleId.LibraryList = "scetia.pbl";
							dw_OldSampleId.DataWindowObject = "d_retest_sampleid_dp";
							dw_OldSampleId.SetTransaction(adoTransaction);
							DataWindowChild child4 = dw_OldSampleId.GetChild("sample_id");
							child4.SetTransaction(adoTransaction);
							child4.Reset();
							child4.Retrieve(Pd.Item_id);
							if (child4.RowCount > 0)
							{
								dw_OldSampleId.Retrieve(Pd.Item_id);
							}
							else
							{
								dw_OldSampleId.Reset();
							}
						}
					}
					try
					{
						DataWindowChild child5 = dw_1.GetChild("waiguandengji");
						child5.SetTransaction(adoTransaction);
						child5.Retrieve(Pd.Sample_id);
					}
					catch
					{
					}
					if (dw_1.RowCount <= 0)
					{
						dw_1.InsertRow(0);
					}
					try
					{
						SetGangJinShuLiang();
					}
					catch
					{
					}
					if (dw_1.DataWindowObject == "d_sampleuc_gangjin_zl")
					{
						num3 = 0;
						num4 = 0;
						num5 = 0;
						DataStore dataStore2 = new DataStore();
						dataStore2.LibraryList = "scetia.pbl";
						dataStore2.DataWindowObject = "d_parameter_getgjzl";
						dataStore2.SetTransaction(adoTransaction);
						dataStore2.Retrieve(Pd.Sample_id, "重量偏差");
						num5 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
						dataStore2.Retrieve(Pd.Sample_id, "抗拉强度");
						num3 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
						dataStore2.Retrieve(Pd.Sample_id, "弯曲性能");
						num4 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
						dw_1.SetItemDecimal(dw_1.CurrentRow, "jianceshuliang", num3);
						dw_1.SetItemDecimal(dw_1.CurrentRow, "gj_wanqushuliang", num4);
						dw_1.SetItemDecimal(dw_1.CurrentRow, "gj_zhongliangshuliang", num5);
					}
				}
				sqlConnection.Close();
			}
			else
			{
				using SqlConnection sqlConnection = CreateConnection();
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				DataStore dataStore = new DataStore();
				dataStore.LibraryList = "scetia.pbl";
				dataStore.DataWindowObject = "d_samplename_child_find";
				dataStore.SetTransaction(adoTransaction);
				dataStore.Retrieve(Pd.Sample_id);
				if (dataStore.RowCount > 0)
				{
					dw_1.DataWindowObject = dataStore.GetItemString(1, "sampleuc");
					Pd.CurrentDwObject = dataStore.GetItemString(1, "sampleuc");
					try
					{
						SetGangJinShuLiang();
					}
					catch
					{
					}
					if (dw_1.DataWindowObject == "d_sampleuc_gangjin_zl")
					{
						num3 = 0;
						num4 = 0;
						num5 = 0;
						DataStore dataStore2 = new DataStore();
						try
						{
							dataStore2.LibraryList = "scetia.pbl";
							dataStore2.DataWindowObject = "d_parameter_getgjzl";
							dataStore2.SetTransaction(adoTransaction);
							dataStore2.Retrieve(Pd.Sample_id, "重量偏差");
							num5 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
							dataStore2.Retrieve(Pd.Sample_id, "抗拉强度");
							num3 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
							dataStore2.Retrieve(Pd.Sample_id, "弯曲性能");
							num4 = (int)dataStore2.GetItemDecimal(1, "specimennumber");
							dw_1.SetItemDecimal(dw_1.CurrentRow, "jianceshuliang", num3);
							dw_1.SetItemDecimal(dw_1.CurrentRow, "gj_wanqushuliang", num4);
							dw_1.SetItemDecimal(dw_1.CurrentRow, "gj_zhongliangshuliang", num5);
						}
						catch
						{
						}
					}
					if (dw_1.DataWindowObject != "" && dw_1.DataWindowObject != null)
					{
						dw_1.SetTransaction(adoTransaction);
						try
						{
							dw_1.SetColumn("product_symbol");
						}
						catch
						{
						}
						if (dw_1.GetColumnName() == "product_symbol")
						{
							string stringValue = "";
							Item.BizProcess.SampleBizProcess sampleBizProcess = new Item.BizProcess.SampleBizProcess();
							List<Item.Entity.SampleEntity> list4 = new List<Item.Entity.SampleEntity>();
							list4 = sampleBizProcess.GetAll("", "SampleID=" + e.Node.Tag, "");
							foreach (Item.Entity.SampleEntity item6 in list4)
							{
								stringValue = item6.SampleSymbol;
							}
							dw_1.SetItemString(dw_1.CurrentRow, "product_symbol", stringValue);
						}
						try
						{
							DataWindowChild child2 = dw_1.GetChild("hntks_gradeid");
							child2.SetTransaction(adoTransaction);
							child2.Retrieve(Pd.Sample_id);
						}
						catch
						{
						}
						try
						{
							DataWindowChild child3 = dw_1.GetChild("tijimidujibie");
							child3.SetTransaction(adoTransaction);
							child3.Retrieve(Pd.Sample_id);
						}
						catch
						{
						}
						if (Combo_JYXZ.Text == "复验")
						{
							dw_OldSampleId.Enabled = true;
							Lb_ReExam.Enabled = true;
							if (Pd.Item_id != 0)
							{
								dw_OldSampleId.LibraryList = "scetia.pbl";
								dw_OldSampleId.DataWindowObject = "d_retest_sampleid_dp";
								dw_OldSampleId.SetTransaction(adoTransaction);
								DataWindowChild child4 = dw_OldSampleId.GetChild("sample_id");
								child4.SetTransaction(adoTransaction);
								child4.Reset();
								child4.Retrieve(Pd.Item_id);
								if (child4.RowCount > 0)
								{
									dw_OldSampleId.Retrieve(Pd.Item_id);
								}
								else
								{
									dw_OldSampleId.Reset();
								}
							}
						}
						try
						{
							DataWindowChild child5 = dw_1.GetChild("waiguandengji");
							child5.SetTransaction(adoTransaction);
							child5.Retrieve(Pd.Sample_id);
						}
						catch
						{
						}
						if (dw_1.RowCount <= 0)
						{
							dw_1.InsertRow(0);
						}
					}
					else
					{
						dw_1.DataWindowObject = "d_sampleuc_default";
						Pd.CurrentDwObject = "d_sampleuc_default";
						dw_1.SetTransaction(adoTransaction);
						if (dw_1.RowCount <= 0)
						{
							dw_1.InsertRow(0);
						}
					}
				}
				sqlConnection.Close();
			}
			string text2 = "";
			string text3 = "";
			string text4 = "";
			string text5 = "";
			string text6 = "";
			int num6 = 0;
			text5 = dw_1.Describe("DataWindow.Objects").Trim() + "\t";
			while (text5.IndexOf('\t') > 0)
			{
				num6 = text5.IndexOf('\t');
				text3 = text5.Substring(0, num6);
				text2 = dw_1.Describe(text3 + ".Band");
				text5 = text5.Substring(num6 + 1, text5.Length - (num6 + 1));
				try
				{
					dw_1.Modify(text3 + ".protect=0");
				}
				catch
				{
				}
			}
			break;
		}
		}
	}

	private void Btn_AddSample_Click(object sender, EventArgs e)
	{
		if (!ShouYangPower.GetShouYangPower("SY_DuoZuShouYang", UserOfClientPart.userGuid.ToString()))
		{
			MessageBox.Show("您没有使用多组收样的权限!");
			return;
		}
		string text = "";
		string text2 = "";
		string text3 = "";
		string text4 = "";
		int num = 0;
		float num2 = 0f;
		if (Combo_JYXZ.Text == "")
		{
			MessageBox.Show("请选择检验性质！");
		}
		if (Pd.TreeLevel < 2)
		{
			MessageBox.Show("请选择你所需要操作的样品！");
			return;
		}
		if (Combo_JCLX.Text == "")
		{
			MessageBox.Show("请选择您所要委托的检测类型");
		}
		if (Combo_YPLB.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品类别！");
			return;
		}
		if (Combo_YPMC.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品名称");
			return;
		}
		if (Combo_Guige.Text == "" && Combo_Guige.Items.Count > 0)
		{
			MessageBox.Show("请选择你所需要操作的规格！");
			return;
		}
		if (Text_ZhuShu.Text == "")
		{
			MessageBox.Show("请录入您所需要委托的组数！");
			return;
		}
		if (dw_GetSample.RowCount <= 0)
		{
			MessageBox.Show("你的合同下取样人未绑定,请绑定后再操作!");
			return;
		}
		if (dw_Witness.RowCount <= 0)
		{
			MessageBox.Show("你的合同下见证人未绑定,请绑定后再操作!");
			return;
		}
		if (dw_1.DataWindowObject == "d_sampleuc_gangjin")
		{
			if (Text_DaiBiaoShuLiang.Text == "")
			{
				MessageBox.Show("请输入所选样品的代表数量!");
				return;
			}
			SetGangJinShuLiang();
			if (dw_1.GetItemDecimal(dw_1.CurrentRow, "jianceshuliang") == 0m && dw_1.GetItemDecimal(dw_1.CurrentRow, "gj_wanqushuliang") == 0m)
			{
				MessageBox.Show("拉伸数量及弯曲数量都为0，请录入相应数据!");
				return;
			}
		}
		if (List_Xiangmu.CheckedItems.Count == 0)
		{
			return;
		}
		Btn_ModifyWeituo.Enabled = false;
		for (num = 0; num <= List_Xiangmu.CheckedItems.Count - 1; num++)
		{
			text = text + GetCanShuIdByName(List_Xiangmu.CheckedItems[num].ToString(), Pd.Sample_id) + ";";
			text2 = text2 + List_Xiangmu.CheckedItems[num].ToString() + ";";
			num2 += GetCanShuFeiYongByName(List_Xiangmu.CheckedItems[num].ToString(), Pd.Sample_id);
			text3 += "0;";
		}
		string text5 = TV_Sample.SelectedNode.Text;
		string text6 = Combo_Guige.Text;
		SampleTempBizProcess sampleTempBizProcess = new SampleTempBizProcess();
		SampleTempEntity sampleTempEntity = new SampleTempEntity();
		sampleTempEntity.ID = Guid.NewGuid();
		sampleTempEntity.IndexNo = Pd.IndexNo;
		sampleTempEntity.Exam_Quan = Convert.ToInt32(Text_ZhuShu.Text);
		sampleTempEntity.Exam_Kind = Combo_JYXZ.Text;
		if (Combo_JYXZ.Text == "复验" && dw_OldSampleId.RowCount > 0)
		{
			dw_OldSampleId.AcceptText();
			sampleTempEntity.ReExam_OldSample_Id = dw_OldSampleId.GetItemString(dw_OldSampleId.CurrentRow, "sample_id");
		}
		sampleTempEntity.Total_Prices = 0.0;
		sampleTempEntity.KindID = (int)Pd.Kind_id;
		sampleTempEntity.ItemID = (int)Pd.Item_id;
		sampleTempEntity.Witness_No = dw_Witness.GetItemString(dw_Witness.CurrentRow, "certificatenumber");
		sampleTempEntity.Sampling_No = dw_GetSample.GetItemString(dw_GetSample.CurrentRow, "certificatenumber");
		sampleTempEntity.Sending_No = Combo_SongYangRenBianHao.Text;
		sampleTempEntity.Deliver_Date = Convert.ToDateTime(DTP_SendSampleDate.Text);
		sampleTempEntity.Sampling_Date = Convert.ToDateTime(DTP_GetSampleDate.Text);
		sampleTempEntity.Carryon_Person = Text_ChengJieRen.Text;
		sampleTempEntity.GetReport_Type = Combo_QuBaoGaoFangShi.Text;
		sampleTempEntity.GetReport_Memo = Text_QuBaoGaoShuoMing.Text;
		sampleTempEntity.Memo = Text_BeiZhu.Text;
		sampleTempEntity.Exam_Info = Text_LiuZhuang.Text;
		sampleTempEntity.Exam_Parameter = text;
		sampleTempEntity.SampleName = Combo_YPMC.Text;
		sampleTempEntity.SpecName = Combo_Guige.Text;
		sampleTempEntity.GradeID = 0;
		sampleTempEntity.Status = text3;
		sampleTempEntity.Prince = num2;
		sampleTempEntity.GradeID = (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id);
		sampleTempEntity.Exam_Parameter_CN = text2;
		sampleTempEntity.Witness_Name = Public_Data.WithnessName;
		sampleTempEntity.Sampling_Name = Public_Data.GetsampleName;
		if (Text_DaiBiaoShuLiang.Text != "")
		{
			sampleTempEntity.Delegate_Quan = Convert.ToDouble(Text_DaiBiaoShuLiang.Text);
		}
		if (Combo_Unit.Text != "")
		{
			sampleTempEntity.Delegate_Quan_Unit = Combo_Unit.Text;
		}
		else
		{
			sampleTempEntity.Delegate_Quan_Unit = "";
		}
		if (dw_1.DataWindowObject != "")
		{
			try
			{
				dw_1.SetColumn("zhizuoriqi");
				if (dw_1.GetColumnName() == "ZhiZuoRiQi" || dw_1.GetColumnName() == "zhizuoriqi")
				{
					sampleTempEntity.Molding_Date = dw_1.GetItemDateTime(dw_1.CurrentRow, "zhizuoriqi");
				}
			}
			catch
			{
			}
			try
			{
				dw_1.SetColumn("lingqi");
				if (dw_1.GetColumnName() == "LingQi" || dw_1.GetColumnName() == "lingqi")
				{
					sampleTempEntity.AgeTime = (int)dw_1.GetItemDecimal(dw_1.CurrentRow, "lingqi");
				}
			}
			catch
			{
			}
		}
		sampleTempEntity.Uc_index = dw_1.RowCount;
		if (dw_1.RowCount > 0)
		{
			dw_1.SetItemDecimal(dw_1.RowCount, "Uc_Index", dw_1.RowCount);
		}
		sampleTempBizProcess.Insert(sampleTempEntity);
		List<SampleTempEntity> list = new List<SampleTempEntity>();
		list = sampleTempBizProcess.GetAll("", "IndexNo='" + Pd.IndexNo + "'", "");
		DBG_SampleTemp.DataSource = list;
		dw_1.InsertRow(0);
		dw_1.ScrollToRow(dw_1.RowCount);
		Pd.MoreSample = 1;
	}

	private void Btn_RemoveSample_Click(object sender, EventArgs e)
	{
		if (DBG_SampleTemp.RowCount <= 0)
		{
			MessageBox.Show("没有需要移除的内容!");
			return;
		}
		if (DBG_SampleTemp.CurrentRow.Cells[0].Value.ToString() == "")
		{
			MessageBox.Show("请选择你所需要删除的内容!");
			return;
		}
		Guid id = (Guid)DBG_SampleTemp.CurrentRow.Cells[0].Value;
		if (dw_1.RowCount > 0)
		{
			int rowNumber = dw_1.FindRow("Uc_index=" + DBG_SampleTemp.CurrentRow.Cells["Uc_index"].Value, 1, dw_1.RowCount);
			dw_1.DeleteRow(rowNumber);
			if (dw_1.RowCount >= 0)
			{
				dw_1.ScrollToRow(1);
			}
		}
		SampleTempBizProcess sampleTempBizProcess = new SampleTempBizProcess();
		SampleTempEntity sampleTempEntity = new SampleTempEntity();
		sampleTempBizProcess.DeleteByID(id);
		List<SampleTempEntity> list = new List<SampleTempEntity>();
		list = sampleTempBizProcess.GetAll("", "IndexNo='" + Pd.IndexNo + "'", "");
		DBG_SampleTemp.DataSource = list;
		if (DBG_SampleTemp.RowCount <= 0)
		{
			Pd.IndexNo = "";
			Pd.MoreSample = 0;
			Btn_ModifyWeituo.Enabled = true;
		}
	}

	private bool ParmFilter(string ContractSerialNumber, string ParameterID)
	{
		string text = "";
		int num = 0;
		DataStore dataStore = new DataStore();
		using SqlConnection sqlConnection = CreateConnection();
		dataStore.LibraryList = "scetia.pbl";
		sqlConnection.Open();
		AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
		adoTransaction.BindConnection();
		dataStore.DataWindowObject = "d_contract_selectedparm";
		dataStore.SetTransaction(adoTransaction);
		dataStore.Retrieve(ContractSerialNumber);
		if (dataStore.RowCount == 0)
		{
			return false;
		}
		for (num = 1; num <= dataStore.RowCount; num++)
		{
			text += dataStore.GetItemString(num, "parametercodestr");
		}
		if (text.IndexOf(ParameterID.ToString()) >= 0)
		{
			return true;
		}
		return false;
	}

	private void PassDwVaild()
	{
		int num = 0;
		for (num = 0; num < dw_1.RowCount; num++)
		{
			if (dw_1.DataWindowObject == "d_sampleuc_gangjin")
			{
				dw_1.GetItemDecimal(dw_1.CurrentRow, "jianceshuliang");
				bool flag = 0 == 0;
			}
			if (dw_1.DataWindowObject == "d_sampleuc_hnt")
			{
				dw_1.GetItemDecimal(dw_1.CurrentRow, "lingqi");
				bool flag = 0 == 0;
				if (dw_1.GetItemString(dw_1.CurrentRow, "hnt_yanghutianjian") == null)
				{
					MessageBox.Show("养护条件不可为空!");
				}
			}
		}
	}

	private void SetDwData()
	{
	}

	private string GetImportId()
	{
		int num = 0;
		string text = "";
		Dw_Import.AcceptText();
		for (num = 1; num <= Dw_Import.RowCount; num++)
		{
			if ((int)Dw_Import.GetItemDecimal(num, "checkflag") == 1)
			{
				try
				{
					text = text + Dw_Import.GetItemString(num, "import_id") + ";";
				}
				catch
				{
				}
			}
		}
		return text;
	}

	private string CheckFuYan()
	{
		int num = 0;
		string text = "";
		Dw_Import.AcceptText();
		for (num = 1; num <= Dw_Import.RowCount; num++)
		{
			if ((int)Dw_Import.GetItemDecimal(num, "checkflag") == 1)
			{
				try
				{
					text = text + Dw_Import.GetItemString(num, "import_id") + ";";
				}
				catch
				{
				}
			}
		}
		return text;
	}

	private double GetDaiBiaoShuLiang()
	{
		int num = 0;
		double num2 = 0.0;
		Dw_Import.AcceptText();
		for (num = 1; num <= Dw_Import.RowCount; num++)
		{
			if ((int)Dw_Import.GetItemDecimal(num, "checkflag") == 1)
			{
				try
				{
					num2 += (double)Dw_Import.GetItemDecimal(num, "prodin_quan");
				}
				catch
				{
				}
			}
		}
		return num2;
	}

	private string GetDaiBiaoShuLiangDanWei()
	{
		int num = 0;
		string text = "";
		Dw_Import.AcceptText();
		for (num = 1; num <= Dw_Import.RowCount; num++)
		{
			if ((int)Dw_Import.GetItemDecimal(num, "checkflag") == 1)
			{
				try
				{
					text = Dw_Import.GetItemString(num, "prodin_unit");
				}
				catch
				{
					text = "";
				}
			}
			if (text != "")
			{
				break;
			}
		}
		return text;
	}

	private string GetNewWaiWeiNo()
	{
		string text = "";
		string text2 = "";
		using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
		{
			sqlConnection.Open();
			string cmdText = "select max(InSide_WaiWeiNo) from WT_WaiWei where left(InSide_WaiWeiNo,8)='" + DateTime.Now.Year.ToString("0000") + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00") + "'";
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			try
			{
				text = Convert.ToString(sqlCommand.ExecuteScalar());
			}
			catch
			{
			}
			sqlConnection.Close();
		}
		if (text == "")
		{
			return DateTime.Now.Year.ToString("0000") + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00") + "01";
		}
		return DateTime.Now.Year.ToString("0000") + DateTime.Now.Month.ToString("00") + DateTime.Now.Day.ToString("00") + (Convert.ToInt64(Public_Fun.Right(text, 2)) + 1).ToString("00");
	}

	private void WaiWei()
	{
		int num = 0;
		string text = "";
		string text2 = "";
		string text3 = "";
		if (dw_WWJcdw.RowCount <= 0)
		{
			MessageBox.Show("未能获取对外检测单位清单，请刷新重试!");
			return;
		}
		for (num = 0; num <= List_Xiangmu.CheckedItems.Count - 1; num++)
		{
			text = text + GetCanShuIdByName(List_Xiangmu.CheckedItems[num].ToString(), Pd.Sample_id) + ";";
			text2 = text2 + List_Xiangmu.CheckedItems[num].ToString() + ";";
			text3 += "0;";
		}
		int num2 = 0;
		string value = "";
		string value2 = "";
		for (num2 = 1; num2 <= Dw_Import.RowCount; num2++)
		{
			if ((int)Dw_Import.GetItemDecimal(num2, "checkflag") == 1)
			{
				try
				{
					value = Dw_Import.GetItemString(num2, "record_certificate");
				}
				catch
				{
				}
				try
				{
					value2 = Dw_Import.GetItemString(num2, "factory_name");
				}
				catch
				{
				}
				break;
			}
			if (num2 == Dw_Import.RowCount || Dw_Import.RowCount == 0)
			{
				MessageBox.Show("请选选择您需要提交的进料信息");
				return;
			}
		}
		string sql = "select * from WT_WaiWei where InSide_WaiWeiNo='WaiWei'";
		DataTable dataTable = new DataTable("WaiWei");
		dataTable = Dw_Public_New.GetDT(sql);
		DataRow dataRow = dataTable.NewRow();
		string newWaiWeiNo = GetNewWaiWeiNo();
		dataRow["ID"] = Guid.NewGuid();
		dataRow["InSide_MemberCode"] = Public_Fun.GetMemberCode(1);
		dataRow["InSide_MemberName"] = Public_Fun.GetMemberCode(2);
		dataRow["InSide_Reason"] = Cb_Reason.Text;
		if (dw_WWJcdw.RowCount > 0)
		{
			dataRow["OutSide_MemberCode"] = dw_WWJcdw.GetItemString(dw_WWJcdw.CurrentRow, "membercode");
		}
		dataRow["InSide_WaiWeiNo"] = newWaiWeiNo;
		dataRow["Public_WaiWeiState"] = 0;
		dataRow["OutSide_ContactSignNo"] = "";
		dataRow["OutSide_Consign_id"] = "";
		dataRow["OutSide_Sample_id"] = "";
		dataRow["Public_Kind_id"] = Pd.Kind_id;
		dataRow["Public_Item_id"] = Pd.Item_id;
		dataRow["Public_SampleID"] = Pd.Sample_id;
		dataRow["Public_Exam_Parameter"] = text;
		dataRow["Public_Exam_parameter_Cn"] = text2;
		dataRow["Public_Spec_ID"] = (int)GetGuiGeIdByName(Combo_Guige.Text, Pd.Sample_id);
		dataRow["Public_GradeID"] = (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id);
		dataRow["Public_Status"] = text3;
		dataRow["Public_Project_Name"] = "Jbz外委";
		dataRow["Public_Exam_Quan"] = 1;
		dataRow["Public_Exam_Kind"] = Combo_JYXZ.Text;
		dataRow["Public_Project_ID"] = "";
		dataRow["Public_Witness_No"] = "无";
		dataRow["Public_Sampling_No"] = "无";
		dataRow["Public_Sending_No"] = "无";
		dataRow["Public_Deliver_Date"] = DateTime.Now;
		dataRow["Public_Sampling_Date"] = DateTime.Now;
		dataRow["Public_Carryon_Person"] = "--";
		dataRow["Public_GetReport_Type"] = "--";
		dataRow["Public_GetReport_Memo"] = "--";
		dataRow["Public_Memo"] = Text_BeiZhu.Text;
		dataRow["Public_Witness_Name"] = "无";
		dataRow["Public_Sampling_Name"] = "无";
		dataRow["Public_ReExam_OldSample_Id"] = "";
		dataRow["Public_Total_Prices"] = 0;
		dataRow["Public_Record_Certificate"] = value;
		dataRow["Public_Produce_Factory"] = value2;
		dataRow["Public_Prince"] = 0;
		dataRow["Public_Exam_Info"] = "";
		dataRow["Public_Sample_Status"] = 0;
		dataRow["Public_Sample_Modify"] = 0;
		dataRow["Public_Exam_Result"] = "";
		dataRow["Public_Sample_Regular"] = 0;
		dataRow["InSide_IsProduce"] = 0;
		try
		{
			dataRow["InSide_Import_Id"] = GetImportId();
			dataRow["Public_Delegate_Quan"] = GetDaiBiaoShuLiang();
			dataRow["Public_Delegate_Quan_Unit"] = GetDaiBiaoShuLiangDanWei();
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUc_Memo"] = dw_1.GetItemString(1, "memo");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUc_FMH_Factory_no"] = dw_1.GetItemString(1, "factory_no");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUc_SN_Product_symbol"] = dw_1.GetItemString(1, "product_symbol");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUc_GJ_gj_rupihao"] = dw_1.GetItemString(1, "gj_rupihao");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUc_GJ_gj_bianmiaobiaoshi"] = dw_1.GetItemString(1, "gj_bianmiaobiaoshi");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUC_GJ_jianceshuliang"] = dw_1.GetItemString(1, "jianceshuliang");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUC_GJ_gj_wanqushuliang"] = dw_1.GetItemString(1, "gj_wanqushuliang");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUC_GJ_gj_zhongliangshuliang"] = dw_1.GetItemString(1, "gj_zhongliangshuliang");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUC_Molding_Date"] = dw_1.GetItemDateTime(dw_1.CurrentRow, "zhizuoriqi");
		}
		catch
		{
		}
		try
		{
			dataRow["SampleUC_AgeTime"] = dw_1.GetItemDecimal(dw_1.CurrentRow, "lingqi");
		}
		catch
		{
		}
		try
		{
			dataRow["ChangeState"] = 0;
		}
		catch
		{
		}
		dataTable.Rows.Add(dataRow);
		dataTable.TableName = "WT_WaiWei";
		using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
		{
			sqlConnection.Open();
			SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(sqlConnection);
			sqlBulkCopy.DestinationTableName = "WT_WaiWei";
			sqlBulkCopy.WriteToServer(dataTable);
			sqlBulkCopy.Close();
		}
		sql = "select * from WT_WaiWei where InSide_WaiWeiNo='" + newWaiWeiNo + "'";
		DataTable dT = Dw_Public_New.GetDT(sql);
		string wWDatatoDb = JsonConvert.SerializeObject(dT);
		string text4 = WWdata.SetWWDatatoDb(wWDatatoDb);
		if (text4 == "")
		{
			MessageBox.Show("外委编号(" + newWaiWeiNo + ")已提交，请联系相关检测单位接收委托数据并进行检测");
		}
		else
		{
			MessageBox.Show("数据交互异常:" + text4);
		}
	}

	private void Btn_Submit_Click(object sender, EventArgs e)
	{
		string text = "";
		string text2 = "";
		string text3 = "";
		string text4 = "";
		string text5 = "";
		string text6 = "";
		string text7 = "";
		string text8 = "";
		string text9 = "";
		string text10 = "";
		int num = 0;
		int num2 = 0;
		float num3 = 0f;
		float num4 = 0f;
		string text11 = "";
		string text12 = "";
		if (Combo_JYXZ.Text == "")
		{
			MessageBox.Show("请选择检验性质！");
		}
		if (Pd.TreeLevel < 2)
		{
			MessageBox.Show("请选择你所需要操作的样品！");
			return;
		}
		if (Combo_JCLX.Text == "")
		{
			MessageBox.Show("请选择您所要委托的检测类型");
		}
		if (Combo_YPLB.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品类别！");
			return;
		}
		if (Combo_YPMC.Text == "")
		{
			MessageBox.Show("请选择您所需要委托的样品名称");
			return;
		}
		if (Combo_Guige.Text == "" && Combo_Guige.Items.Count > 0)
		{
			MessageBox.Show("请选择你所需要操作的规格！");
			return;
		}
		if (Combo_QiangDuDengJi.Text == "" && Combo_QiangDuDengJi.Items.Count > 0)
		{
			MessageBox.Show("请选择你所需要操作的强度等级！");
			return;
		}
		if (Text_ZhuShu.Text == "")
		{
			MessageBox.Show("请录入您所需要委托的组数！");
			return;
		}
		if (List_Xiangmu.CheckedItems.Count == 0)
		{
			MessageBox.Show("请录入您所需要委托的参数！");
			return;
		}
		if (Combo_JYXZ.Text == "外委")
		{
			WaiWei();
			return;
		}
		for (int i = 0; i <= List_Xiangmu.CheckedItems.Count - 1; i++)
		{
			text = text + GetCanShuIdByName(List_Xiangmu.CheckedItems[i].ToString(), Pd.Sample_id) + ";";
			text2 = text2 + List_Xiangmu.CheckedItems[i].ToString() + ";";
			num3 += GetCanShuFeiYongByName(List_Xiangmu.CheckedItems[i].ToString(), Pd.Sample_id);
			text8 += "0;";
		}
		DataStore dataStore = new DataStore();
		Dw_Public.GetData_Ds(dataStore, "d_modify_currentnewid");
		dataStore.SetFilter("itemid=" + Pd.Item_id + " and yearstr='" + DateTime.Today.Year.ToString().Substring(2, 2) + "'");
		dataStore.Filter();
		if (dataStore.RowCount > 0)
		{
			text3 = DateTime.Today.Year.ToString().Substring(2, 2) + Pd.Item_id.ToString().Substring(2, 2) + dataStore.GetItemString(dataStore.CurrentRow, "currentconsignid");
			text4 = DateTime.Today.Year.ToString().Substring(2, 2) + Pd.Item_id.ToString().Substring(2, 2) + dataStore.GetItemString(dataStore.CurrentRow, "currentsampleid");
		}
		else
		{
			text3 = DateTime.Today.Year.ToString().Substring(2, 2) + Pd.Item_id.ToString().Substring(2, 2) + "000001";
			text4 = DateTime.Today.Year.ToString().Substring(2, 2) + Pd.Item_id.ToString().Substring(2, 2) + "000001";
		}
		CurrentIdBizProcess currentIdBizProcess = new CurrentIdBizProcess();
		List<CurrentIdEntity> list = new List<CurrentIdEntity>();
		using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
		{
			sqlConnection.Open();
			string cmdText = "select max(Consign_id) from wt_consign where itemid=" + Pd.Item_id + " and left(consign_id,2)='" + DateTime.Today.Year.ToString().Substring(2, 2) + "'";
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			try
			{
				text11 = Convert.ToString(sqlCommand.ExecuteScalar());
			}
			catch
			{
			}
			sqlConnection.Close();
		}
		using (SqlConnection sqlConnection = Dw_Public.CreateConnection())
		{
			sqlConnection.Open();
			string cmdText = "select max(sample_id) from wt_sample where itemid=" + Pd.Item_id + " and left(sample_id,2)='" + DateTime.Today.Year.ToString().Substring(2, 2) + "'";
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			try
			{
				text12 = Convert.ToString(sqlCommand.ExecuteScalar());
			}
			catch
			{
			}
			sqlConnection.Close();
		}
		if (text11 != "" || text12 != "")
		{
			int num5 = 0;
			int num6 = 0;
			string text13 = "";
			if (text11 != "" && Convert.ToInt64(text11.Substring(4, 6)) >= Convert.ToInt64(text3.Substring(4, 6)))
			{
				num5 = 1;
				text13 = "委托";
			}
			if (text12 != "" && Convert.ToInt64(text12.Substring(4, 6)) >= Convert.ToInt64(text4.Substring(4, 6)))
			{
				num6 = 1;
				text13 += "样品";
			}
			if (num5 == 1 || num6 == 1)
			{
				if (MessageBox.Show("当前存在的(" + text13 + ")编号,大于等于编号设置中的下一编号,处理方法:\n按是系统自动在最大委托(样品)编号中+1做为新编号并继续提交!\n按否取消提交操作用户自行处理!", "警告", MessageBoxButtons.YesNo) != DialogResult.Yes)
				{
					return;
				}
				if (num5 == 1)
				{
					text3 = (Convert.ToInt64(text11) + 1).ToString();
				}
				if (num6 == 1)
				{
					text4 = (Convert.ToInt64(text12) + 1).ToString();
				}
			}
		}
		text9 = text4;
		int num7 = 0;
		string record_Certificate = "";
		string produce_Factory = "";
		Dw_Import.AcceptText();
		for (num7 = 1; num7 <= Dw_Import.RowCount; num7++)
		{
			if ((int)Dw_Import.GetItemDecimal(num7, "checkflag") == 1)
			{
				try
				{
					record_Certificate = Dw_Import.GetItemString(num7, "record_certificate");
				}
				catch
				{
				}
				try
				{
					produce_Factory = Dw_Import.GetItemString(num7, "factory_name");
				}
				catch
				{
				}
				break;
			}
			if (num7 == Dw_Import.RowCount || Dw_Import.RowCount == 0)
			{
				MessageBox.Show("请选选择您需要提交的进料信息");
				return;
			}
		}
		if (Pd.MoreSample != 1)
		{
			PassDwVaild();
			ConsignBizProcess consignBizProcess = new ConsignBizProcess();
			ConsignEntity consignEntity = new ConsignEntity();
			consignEntity.Id = Guid.NewGuid();
			consignEntity.ConSign_ID = text3;
			consignEntity.Sample_ID = text4;
			consignEntity.KindID = (int)Pd.Kind_id;
			consignEntity.ItemID = (int)Pd.Item_id;
			consignEntity.ProJect_Name = "JBZ";
			consignEntity.Exam_Quan = Convert.ToInt32(Text_ZhuShu.Text);
			consignEntity.Exam_Kind = Combo_JYXZ.Text;
			consignEntity.Project_ID = "1";
			consignEntity.Witness_No = "11";
			consignEntity.Sampling_No = "11";
			consignEntity.Sending_No = Combo_SongYangRenBianHao.Text;
			consignEntity.Sampling_Date = Convert.ToDateTime(DTP_GetSampleDate.Text);
			consignEntity.Carryon_Person = Text_ChengJieRen.Text;
			consignEntity.GetReport_Type = Combo_QuBaoGaoFangShi.Text;
			consignEntity.GetReport_Memo = Text_QuBaoGaoShuoMing.Text;
			consignEntity.Memo = Text_BeiZhu.Text;
			if (Combo_JYXZ.Text == "复验" && dw_OldSampleId.RowCount > 0)
			{
				dw_OldSampleId.AcceptText();
				consignEntity.ReExam_OldSample_Id = dw_OldSampleId.GetItemString(dw_OldSampleId.CurrentRow, "sample_id");
			}
			consignEntity.Total_Prices = num3 * (float)Convert.ToInt64(Text_ZhuShu.Text);
			consignBizProcess.Insert(consignEntity);
			Consign.BizProcess.SampleBizProcess sampleBizProcess = new Consign.BizProcess.SampleBizProcess();
			Consign.Entity.SampleEntity sampleEntity = new Consign.Entity.SampleEntity();
			for (int i = 0; i < Convert.ToInt64(Text_ZhuShu.Text); i++)
			{
				sampleEntity.ID = Guid.NewGuid();
				sampleEntity.ConSign_ID = text3;
				sampleEntity.Sample_ID = (10000000000L + (Convert.ToInt64(text4) + i)).ToString().Substring(1, 10);
				sampleEntity.KindID = (int)Pd.Kind_id;
				sampleEntity.ItemID = (int)Pd.Item_id;
				sampleEntity.SampleID = (int)Pd.Sample_id;
				sampleEntity.Exam_Parameter = text;
				sampleEntity.Spec_ID = (int)GetGuiGeIdByName(Combo_Guige.Text, Pd.Sample_id);
				sampleEntity.GradeID = (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id);
				sampleEntity.Status = text8;
				sampleEntity.Record_Certificate = record_Certificate;
				sampleEntity.Produce_Factory = produce_Factory;
				sampleEntity.Prince = num3;
				sampleEntity.GradeID = (int)GetGradeIdByName(Combo_QiangDuDengJi.Text, Pd.Sample_id);
				sampleEntity.Exam_parameter_Cn = text2;
				sampleEntity.Exam_Info = Text_LiuZhuang.Text;
				sampleEntity.Sample_Status = 0;
				sampleEntity.Sample_Modify = 0;
				sampleEntity.IsProduce = 0;
				sampleEntity.Import_Id = GetImportId();
				sampleEntity.Delegate_Quan = GetDaiBiaoShuLiang();
				sampleEntity.Delegate_Quan_Unit = GetDaiBiaoShuLiangDanWei();
				if (dw_1.DataWindowObject != "")
				{
					try
					{
						dw_1.SetColumn("zhizuoriqi");
					}
					catch
					{
					}
					if (dw_1.GetColumnName() == "zhizuoriqi")
					{
						sampleEntity.Molding_Date = dw_1.GetItemDateTime(dw_1.CurrentRow, "zhizuoriqi");
					}
					try
					{
						dw_1.SetColumn("lingqi");
					}
					catch
					{
					}
					if (dw_1.GetColumnName() == "lingqi")
					{
						sampleEntity.AgeTime = (int)dw_1.GetItemDecimal(dw_1.CurrentRow, "lingqi");
					}
					try
					{
						dw_1.SetColumn("projectpart");
						if (dw_1.GetColumnName() == "projectpart")
						{
							sampleEntity.ProJect_Part = dw_1.GetItemString(dw_1.CurrentRow, "projectpart");
						}
					}
					catch
					{
					}
				}
				sampleBizProcess.Insert(sampleEntity);
				Public_Data.Sample_ID = Convert.ToInt64(text4) + i;
				if (!(dw_1.DataWindowObject != ""))
				{
					continue;
				}
				if (i == 0)
				{
					dw_1.SetItemString(1, "sample_id", (10000000000L + (Convert.ToInt64(text4) + i)).ToString().Substring(1, 10).ToString());
				}
				else
				{
					dw_1.RowsCopy(1, 1, DataBuffer.Primary, dw_1, dw_1.RowCount + 1, DataBuffer.Primary);
					dw_1.SelectRow(dw_1.RowCount, Select: false);
					dw_1.SetItemString(dw_1.RowCount, "sample_id", (10000000000L + (Convert.ToInt64(text4) + i)).ToString().Substring(1, 10).ToString());
				}
				using SqlConnection sqlConnection = CreateConnection();
				dw_1.LibraryList = "scetia.pbl";
				dw_1.DataWindowObject = Pd.CurrentDwObject;
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				dw_1.SetTransaction(adoTransaction);
				try
				{
					dw_1.AcceptText();
					dw_1.UpdateData();
					string cmdText = "Update WT_Sample Set Delegate_Quan_Unit=N'" + GetDaiBiaoShuLiangDanWei() + "' where Sample_ID='" + (10000000000L + (Convert.ToInt64(text4) + i)).ToString().Substring(1, 10).ToString() + "'";
					SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
					try
					{
						sqlCommand.ExecuteNonQuery();
					}
					catch
					{
					}
				}
				catch (DbErrorException ex)
				{
					MessageBox.Show("更新不成功！原因：" + ex.SqlErrorText);
					adoTransaction.Transaction.Rollback();
				}
				catch (DataWindowNotCreatedException)
				{
					MessageBox.Show("数据窗口还没有创建！");
					adoTransaction.Transaction.Rollback();
				}
				catch (MethodFailureException ex3)
				{
					MessageBox.Show("更新不成功！原因：" + ex3.Message.ToString());
					adoTransaction.Transaction.Rollback();
				}
				catch
				{
					MessageBox.Show("更新不成功,请检查网络！");
				}
			}
			if (dataStore.RowCount <= 0)
			{
				dataStore.InsertRow(0);
			}
			dataStore.SetItemString(dataStore.CurrentRow, "yearstr", DateTime.Now.Year.ToString().Substring(2, 2));
			dataStore.SetItemDecimal(dataStore.CurrentRow, "itemid", Pd.Item_id);
			dataStore.SetItemString(dataStore.CurrentRow, "currentconsignid", (10000000000L + (Convert.ToInt64(text3) + 1)).ToString().Substring(5, 6));
			dataStore.SetItemString(dataStore.CurrentRow, "currentsampleid", (10000000000L + (Convert.ToInt64(text4) + 1)).ToString().Substring(5, 6));
			Dw_Public.Save_NoMessage_Ds(dataStore);
			if (Text_ZhuShu.Text != "1")
			{
				text4 = text4 + "~" + (Convert.ToInt64(text4) + (Convert.ToInt64(Text_ZhuShu.Text) - 1));
			}
			MessageBox.Show("委托信息提交成功!\n已生成的委托编号为:(" + text3 + ")\n已生成的样品编号为:(" + text4 + ")");
		}
		else
		{
			dw_1.DeleteRow(dw_1.RowCount);
			PassDwVaild();
			SampleTempBizProcess sampleTempBizProcess = new SampleTempBizProcess();
			List<SampleTempEntity> list2 = new List<SampleTempEntity>();
			list2 = sampleTempBizProcess.GetAll("", "IndexNo='" + Pd.IndexNo + "'", "");
			int num8 = 0;
			int num9 = 0;
			long num10 = 0L;
			foreach (SampleTempEntity item in list2)
			{
				num += item.Exam_Quan;
				num2++;
				if (num2 == DBG_SampleTemp.RowCount)
				{
					ConsignBizProcess consignBizProcess = new ConsignBizProcess();
					ConsignEntity consignEntity = new ConsignEntity();
					consignEntity.Id = Guid.NewGuid();
					consignEntity.ConSign_ID = text3;
					consignEntity.Sample_ID = text9;
					consignEntity.KindID = item.KindID;
					consignEntity.ItemID = item.ItemID;
					consignEntity.ProJect_Name = item.ProJect_Name;
					consignEntity.ProJect_Name_Addon = item.ProJect_Name_Addon;
					consignEntity.Exam_Quan = num;
					consignEntity.Exam_Kind = item.Exam_Kind;
					consignEntity.Witness_No = item.Witness_No;
					consignEntity.Sampling_No = item.Sampling_No;
					consignEntity.Sending_No = item.Sending_No;
					consignEntity.Deliver_Date = item.Deliver_Date;
					consignEntity.Sampling_Date = item.Sampling_Date;
					consignEntity.Carryon_Person = item.Carryon_Person;
					consignEntity.GetReport_Type = item.GetReport_Type;
					consignEntity.GetReport_Memo = item.GetReport_Memo;
					consignEntity.ReExam_OldSample_Id = item.ReExam_OldSample_Id;
					consignEntity.Memo = item.Memo;
					consignEntity.Sampling_Name = item.Sampling_Name;
					consignEntity.Witness_Name = item.Witness_Name;
					consignEntity.Total_Prices = (double)num4 + item.Prince;
					consignBizProcess.Insert(consignEntity);
				}
				Consign.BizProcess.SampleBizProcess sampleBizProcess = new Consign.BizProcess.SampleBizProcess();
				Consign.Entity.SampleEntity sampleEntity = new Consign.Entity.SampleEntity();
				num10 = item.Exam_Quan;
				for (int i = 0; i < item.Exam_Quan; i++)
				{
					sampleEntity.ID = Guid.NewGuid();
					sampleEntity.ConSign_ID = text3;
					sampleEntity.Sample_ID = (Convert.ToInt64(text4) + num - item.Exam_Quan + i).ToString();
					text10 = (Convert.ToInt64(text4) + num - item.Exam_Quan + i).ToString();
					sampleEntity.KindID = item.KindID;
					sampleEntity.ItemID = item.ItemID;
					sampleEntity.SampleID = (int)GetSampleIdByName(item.SampleName, item.ItemID);
					sampleEntity.Exam_Parameter = item.Exam_Parameter;
					sampleEntity.Spec_ID = (int)GetGuiGeIdByName(item.SpecName, (int)GetSampleIdByName(item.SampleName, item.ItemID));
					sampleEntity.ProJect_Part = item.ProJect_Part;
					sampleEntity.Status = item.Status;
					sampleEntity.Prince = item.Prince;
					num4 = (float)((double)num4 + item.Prince).Value;
					sampleEntity.GradeID = item.GradeID;
					sampleEntity.Delegate_Quan = item.Delegate_Quan;
					sampleEntity.Exam_parameter_Cn = item.Exam_Parameter_CN;
					sampleEntity.Exam_Info = item.Exam_Info;
					sampleEntity.Sample_Status = 0;
					sampleEntity.Molding_Date = item.Molding_Date;
					sampleEntity.Sample_Modify = 0;
					sampleEntity.Delegate_Quan_Unit = item.Delegate_Quan_Unit;
					sampleEntity.IsProduce = 0;
					sampleEntity.Import_Id = GetImportId();
					sampleBizProcess.Insert(sampleEntity);
				}
				if (dw_1.DataWindowObject != "")
				{
					for (int j = 0; j < item.Exam_Quan; j++)
					{
						if (j == 0)
						{
							dw_1.SetItemString(num8 + 1, "sample_id", (Convert.ToInt64(text4) + num9).ToString());
							text10 = (Convert.ToInt64(text4) + num9).ToString();
							num9++;
						}
						else
						{
							dw_1.RowsCopy(num8 + 1, num8 + 1, DataBuffer.Primary, dw_1, dw_1.RowCount + 1, DataBuffer.Primary);
							dw_1.SelectRow(dw_1.RowCount, Select: false);
							dw_1.SetItemString(dw_1.RowCount, "sample_id", (Convert.ToInt64(text4) + num9).ToString());
							text10 = (Convert.ToInt64(text4) + num9).ToString();
							num9++;
						}
					}
				}
				num8++;
			}
			CurrentIdEntity currentIdEntity = new CurrentIdEntity();
			currentIdEntity.CurrentConsignId = (Convert.ToInt64(text3) + 1).ToString();
			currentIdEntity.CurrentSampleId = (Convert.ToInt64(text10) + 1).ToString();
			currentIdEntity.YearStr = DateTime.Today.Year.ToString();
			text4 = (Convert.ToInt64(text10) + 1).ToString();
			currentIdEntity.LockTable = false;
			currentIdBizProcess.InsertUpdate(currentIdEntity);
			using (SqlConnection sqlConnection = CreateConnection())
			{
				dw_1.LibraryList = "scetia.pbl";
				dw_1.DataWindowObject = Pd.CurrentDwObject;
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				dw_1.SetTransaction(adoTransaction);
				try
				{
					dw_1.AcceptText();
					dw_1.UpdateData();
				}
				catch (DbErrorException ex)
				{
					MessageBox.Show("更新不成功！原因：" + ex.SqlErrorText);
				}
				catch (DataWindowNotCreatedException)
				{
					MessageBox.Show("数据窗口还没有创建！");
				}
				catch (MethodFailureException ex3)
				{
					MessageBox.Show("更新不成功！原因：" + ex3.Message.ToString());
				}
				catch
				{
					MessageBox.Show("更新不成功,请检查网络！");
				}
			}
			for (int j = num9; j > 0; j--)
			{
				string text14 = "";
				using SqlConnection sqlConnection = CreateConnection();
				sqlConnection.Open();
				DataStore dataStore2 = new DataStore();
				dataStore2.LibraryList = "scetia.pbl";
				dataStore2.DataWindowObject = "d_sample_find";
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				dataStore2.SetTransaction(adoTransaction);
				dataStore2.Retrieve((Convert.ToInt64(text4) - j).ToString());
				text14 = dataStore2.GetItemString(dataStore2.CurrentRow, "Record_Certificate");
				string text15 = text14;
				string cmdText = "Select SurfaceFlagPicture from Unit_ProductionUnit where PutOnRecordsPassport='" + text15 + "'";
				SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
				byte[] array = (byte[])sqlCommand.ExecuteScalar();
				MemoryStream memoryStream = new MemoryStream(array);
				string cmdText2 = "update SampleUC_GangJin set Gj_BianMiaoBiaoShi_Image=@img where Sample_ID='" + (Convert.ToInt64(text4) - j) + "'";
				SqlCommand sqlCommand2 = new SqlCommand(cmdText2, sqlConnection);
				sqlCommand2.Parameters.Add("@img", SqlDbType.Image);
				sqlCommand2.Parameters[0].Value = array;
				try
				{
					sqlCommand2.ExecuteNonQuery();
				}
				catch (Exception ex4)
				{
					MessageBox.Show(ex4.Message);
				}
				memoryStream = null;
			}
			string text16 = (Convert.ToInt64(text10) - Convert.ToInt64(text9) + 1).ToString();
			if (text9 != text10)
			{
				text9 = text9 + " ~ " + text10;
			}
			DeleteYPTemp(Pd.IndexNo);
			Pd.MoreSample = 0;
			MessageBox.Show("委托信息提交成功!\n已生成的委托编号为:(" + text3 + ")\n共生成样品(" + text16 + ")组,编号为:(" + text9 + ")");
			Pd.IndexNo = "";
		}
		int num11 = 0;
		SqlConnection sqlConnection2 = CreateConnection();
		sqlConnection2.Open();
		for (num11 = 1; num11 <= Dw_Import.RowCount; num11++)
		{
			if ((int)Dw_Import.GetItemDecimal(num11, "checkflag") == 1)
			{
				string cmdText = "Update Import_List set Sampling=1 Where Import_Id='" + Dw_Import.GetItemString(num11, "import_id") + "'";
				SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection2);
				try
				{
					sqlCommand.ExecuteNonQuery();
				}
				catch (SqlException ex5)
				{
					MessageBox.Show(ex5.Message.ToString());
					sqlConnection2.Close();
					return;
				}
			}
		}
		sqlConnection2.Close();
		dw_1.Reset();
		dw_1.InsertRow(0);
		Btn_ModifyWeituo.Enabled = true;
		PrintLiuZhuan(text3);
		SelectTimes = 0;
		FirstSpecid = 0L;
		FirstGradeid = 0L;
		FirstGroupid = "";
		for (num7 = 1; num7 <= Dw_Import.RowCount; num7++)
		{
			if ((int)Dw_Import.GetItemDecimal(num7, "checkflag") == 1)
			{
				Dw_Import.SetItemDecimal(num7, "checkflag", 0m);
			}
		}
	}

	private void Btn_Exit_Click(object sender, EventArgs e)
	{
		NewWeituo();
	}

	private void Text_ZhuShu_KeyPress(object sender, KeyPressEventArgs e)
	{
		if (e.KeyChar != '\b' && !char.IsDigit(e.KeyChar))
		{
			e.Handled = true;
		}
	}

	private void From_ShouYang_FormClosing(object sender, FormClosingEventArgs e)
	{
		if (DBG_SampleTemp.RowCount > 0)
		{
			DeleteYPTemp(DBG_SampleTemp.CurrentRow.Cells["IndexNo"].Value.ToString());
		}
	}

	private void SearchNode(TreeNodeCollection tnds, string text)
	{
		foreach (TreeNode tnd in tnds)
		{
			if (tnd.Text == text)
			{
				MessageBox.Show("Get   Node   :" + text);
				tnd.Parent.Expand();
				tnd.ExpandAll();
				break;
			}
			if (tnd.Nodes.Count != 0)
			{
				SearchNode(tnd.Nodes, text);
			}
		}
	}

	private void Text_IC_KeyPress(object sender, KeyPressEventArgs e)
	{
		if (e.KeyChar != '\b' && !char.IsDigit(e.KeyChar))
		{
			e.Handled = true;
		}
	}

	private void Btn_ModifyWeituo_Click(object sender, EventArgs e)
	{
		Form_ModifyWeituo form_ModifyWeituo = new Form_ModifyWeituo();
		form_ModifyWeituo.ShowDialog();
	}

	private void Btn_Contract_Click(object sender, EventArgs e)
	{
		Form_ContractManage form_ContractManage = new Form_ContractManage();
		form_ContractManage.ShowDialog();
	}

	private void DBG_SampleTemp_CellClick(object sender, DataGridViewCellEventArgs e)
	{
		if (e.RowIndex >= 0)
		{
			int rowNumber = dw_1.FindRow("Uc_index=" + DBG_SampleTemp.CurrentRow.Cells["Uc_index"].Value, 1, dw_1.RowCount);
			dw_1.ScrollToRow(rowNumber);
		}
	}

	private void DBG_SampleTemp_Leave(object sender, EventArgs e)
	{
		if (dw_1.RowCount > 0)
		{
			dw_1.ScrollToRow(dw_1.RowCount);
		}
	}

	private void DBG_SampleTemp_CellContentClick(object sender, DataGridViewCellEventArgs e)
	{
	}

	private void Text_HTDJ_TextChanged(object sender, EventArgs e)
	{
	}

	private void Cb_LiuZhuan_CheckedChanged(object sender, EventArgs e)
	{
		Cb_QuBaoGao.Checked = Cb_LiuZhuan.Checked;
	}

	private void PrintLiuZhuan(string consign_id)
	{
		using (SqlConnection sqlConnection = CreateConnection())
		{
			Dw_2.LibraryList = "scetia.pbl";
			if (!Cb_LiuZhuan.Checked)
			{
				return;
			}
			if (Cb_QuBaoGao.Checked)
			{
				Dw_2.DataWindowObject = "d_liuzhuang_all";
			}
			else
			{
				Dw_2.DataWindowObject = "d_liuzhuang";
			}
			sqlConnection.Open();
			AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
			adoTransaction.BindConnection();
			Dw_2.SetTransaction(adoTransaction);
			Dw_2.PrintProperties.Preview = true;
			Dw_2.PrintProperties.ShowPreviewButtons = true;
			Dw_2.PrintProperties.ShowPreviewRulers = true;
			DataStore dataStore = new DataStore();
			string text = "";
			dataStore.LibraryList = "scetia.pbl";
			dataStore.DataWindowObject = "d_unit_info";
			dataStore.SetTransaction(adoTransaction);
			dataStore.Retrieve();
			if (dataStore.RowCount > 0)
			{
				text = dataStore.GetItemString(1, "unit_name");
			}
			DataStore dataStore2 = new DataStore();
			string text2 = "";
			dataStore2.LibraryList = "scetia.pbl";
			dataStore2.DataWindowObject = "d_contract_contractid";
			dataStore2.SetTransaction(adoTransaction);
			if (dataStore2.RowCount > 0)
			{
				text2 = dataStore2.GetItemString(1, "EntrustUnitName");
			}
			Dw_2.Retrieve(consign_id, consign_id);
			for (int i = 1; i <= Dw_2.RowCount; i++)
			{
				if (Cb_QuBaoGao.Checked)
				{
					DataWindowChild child = Dw_2.GetChild("dw_1");
					child.Modify("t_title.text='" + text + "'");
					DataWindowChild child2 = Dw_2.GetChild("dw_2");
					child2.Modify("t_title2.text='" + text + "'");
					child2.Modify("t_weituodanwei.text='" + text2 + "'");
				}
			}
		}
		Dw_2.AcceptText();
		try
		{
			if (Rb_LianXu.Checked)
			{
				Dw_2.PrintProperties.PaperSize = 256;
				Dw_2.PrintProperties.CustomPageLength = 148;
				Dw_2.PrintProperties.CustomPageWidth = 210;
			}
			if (Rb_Default.Checked)
			{
				Dw_2.PrintProperties.PaperSize = 256;
				Dw_2.PrintProperties.CustomPageLength = 210;
				Dw_2.PrintProperties.CustomPageWidth = 148;
				Dw_2.PrintProperties.Orientation = PrintProperties.PrintOrientation.Landscape;
			}
			Dw_2.Print();
		}
		catch
		{
		}
	}

	private void Btn_DownLoad_Click(object sender, EventArgs e)
	{
		if (!ShouYangPower.GetShouYangPower("SY_XiaZaiCanShu", UserOfClientPart.userGuid.ToString()))
		{
			MessageBox.Show("您没有下载参数的权限!");
			return;
		}
		Form_Wait form_Wait = new Form_Wait();
		form_Wait.Show();
		Application.DoEvents();
		string message = "";
		if (!DownLoadAll.DownKind(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownItem(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownSample(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownSpec(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownParameter(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownGrade(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllGJ_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllAgeTimeForSpecial(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllSS_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllZ_MD_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownAllZ_QD_standard(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		if (!DownLoadAll.DownTestFee(UserOfClientPart.userName, UserOfClientPart.userPwd, out message))
		{
			MessageBox.Show(message);
			return;
		}
		TV_Sample.Nodes.Clear();
		CreateTv(11, 0);
		form_Wait.Close();
		MessageBox.Show("下载成功!");
	}

	private void Text_DaiBiaoShuLiang_KeyPress(object sender, KeyPressEventArgs e)
	{
		if (e.KeyChar != '\b' && !char.IsDigit(e.KeyChar) && e.KeyChar != '.')
		{
			e.Handled = true;
		}
	}

	private void TV_Sample_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
	{
	}

	private void Text_DaiBiaoShuLiang_Leave(object sender, EventArgs e)
	{
		SetGangJinShuLiang();
	}

	private void Text_ZhuShu_TextChanged(object sender, EventArgs e)
	{
	}

	private void Text_ZhuShu_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_DaiBiaoShuLiang_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Combo_Unit_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void DTP_SendSampleDate_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void DTP_GetSampleDate_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_ChengJieRen_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Combo_SongYangRenBianHao_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Combo_QuBaoGaoFangShi_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_QuBaoGaoShuoMing_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_GongChengBuWei_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Combo_SuoShuQuXian_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Combo_ShengChanChangJia_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_BeiZhu_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_LiuZhuang_TextChanged(object sender, EventArgs e)
	{
	}

	private void Text_LiuZhuang_KeyDown(object sender, KeyEventArgs e)
	{
		if (e.KeyCode == Keys.Return)
		{
			SelectNextControl(base.ActiveControl, forward: true, tabStopOnly: true, nested: true, wrap: true);
		}
	}

	private void Text_DaiBiaoShuLiang_Enter(object sender, EventArgs e)
	{
		if (dw_1.DataWindowObject == "d_sampleuc_gangjin")
		{
			if (Combo_YPMC.Text == "")
			{
				MessageBox.Show("请选择您所需要委托的样品名称");
				TV_Sample.Focus();
			}
			else if (Combo_Guige.Text == "" && Combo_Guige.Items.Count > 0)
			{
				MessageBox.Show("请选择你所需要操作的规格！");
				Combo_Guige.Focus();
			}
			else if (Combo_QiangDuDengJi.Text == "" && Combo_QiangDuDengJi.Items.Count > 0)
			{
				MessageBox.Show("请选择你所需要操作的强度等级！");
				Combo_QiangDuDengJi.Focus();
			}
		}
	}

	private void dw_Witness_Leave(object sender, EventArgs e)
	{
	}

	private void dw_GetSample_Leave(object sender, EventArgs e)
	{
	}

	private void button1_Click_1(object sender, EventArgs e)
	{
	}

	private void Combo_JYXZ_SelectedIndexChanged(object sender, EventArgs e)
	{
		if (Combo_JYXZ.Text == "取样" || Combo_JYXZ.Text == "复验")
		{
			try
			{
				dw_WWJcdw.DataWindowObject = "";
			}
			catch
			{
			}
			CreateTv(11, 0);
			List_Xiangmu.Items.Clear();
			dw_WWJcdw.Enabled = false;
		}
		if (Combo_JYXZ.Text == "外委")
		{
			dw_WWJcdw.Enabled = true;
			CreateTv(11, 1);
			List_Xiangmu.Items.Clear();
			TV_Sample.CollapseAll();
		}
		if (Combo_JYXZ.Text == "复验")
		{
			dw_OldSampleId.Enabled = true;
			Lb_ReExam.Enabled = true;
			if (Pd.Item_id != 0)
			{
				SqlConnection sqlConnection = CreateConnection();
				sqlConnection.Open();
				AdoTransaction adoTransaction = new AdoTransaction(sqlConnection, "");
				adoTransaction.BindConnection();
				dw_OldSampleId.LibraryList = "scetia.pbl";
				dw_OldSampleId.DataWindowObject = "d_retest_sampleid_dp";
				dw_OldSampleId.SetTransaction(adoTransaction);
				DataWindowChild child = dw_OldSampleId.GetChild("sample_id");
				child.SetTransaction(adoTransaction);
				child.Reset();
				child.Retrieve(Pd.Item_id);
				if (child.RowCount > 0)
				{
					dw_OldSampleId.Retrieve(Pd.Item_id);
				}
				else
				{
					dw_OldSampleId.Reset();
				}
				sqlConnection.Close();
			}
		}
		else
		{
			dw_OldSampleId.Enabled = false;
			Lb_ReExam.Enabled = false;
		}
	}

	private void Dw_Import_Click(object sender, EventArgs e)
	{
	}

	private void Dw_Import_RowFocusChanged(object sender, RowFocusChangedEventArgs e)
	{
	}

	private void Dw_Import_SqlPreview(object sender, SqlPreviewEventArgs e)
	{
	}

	private void Dw_Import_ItemChanged(object sender, Sybase.DataWindow.ItemChangedEventArgs e)
	{
		if (!(e.ColumnName == "checkflag") || !(Dw_Import.DataWindowObject == "d_import_retrieve"))
		{
			return;
		}
		if (e.Data == "1")
		{
			long num = (long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid");
			long num2 = (long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid");
			string itemString = Dw_Import.GetItemString(Dw_Import.CurrentRow, "Groupid");
			if (SelectTimes == 0)
			{
				FirstSpecid = (long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid");
				FirstGradeid = (long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid");
				FirstGroupid = Dw_Import.GetItemString(Dw_Import.CurrentRow, "Groupid");
			}
			if (FirstSpecid != num)
			{
				MessageBox.Show("选择材料时只可选择同一规格!");
				e.Action = ItemChangedAction.RejectAndAllowFocusChange;
			}
			else if (FirstGradeid != num2)
			{
				MessageBox.Show("选择材料时只可选择同一强度!");
				e.Action = ItemChangedAction.RejectAndAllowFocusChange;
			}
			else if (FirstGroupid != itemString)
			{
				MessageBox.Show("选择材料时只可选择同一批号!");
				e.Action = ItemChangedAction.RejectAndAllowFocusChange;
			}
			else
			{
				SelectTimes++;
				Combo_Guige.Text = GetGuiGeNameById((long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "specid"), Pd.Sample_id);
				Combo_QiangDuDengJi.Text = GetGradeNameById((long)Dw_Import.GetItemDecimal(Dw_Import.CurrentRow, "gradeid"), Pd.Sample_id);
			}
		}
		else
		{
			if (SelectTimes > 0)
			{
				SelectTimes--;
			}
			if (SelectTimes == 0)
			{
				FirstSpecid = 0L;
				FirstGradeid = 0L;
				FirstGroupid = "";
				Combo_Guige.Text = "";
				Combo_QiangDuDengJi.Text = "";
			}
		}
	}

	private void Btn_Sort_Click(object sender, EventArgs e)
	{
		if (Dw_Import.DataWindowObject == "")
		{
			MessageBox.Show("没有需要排序的内容!");
			return;
		}
		try
		{
			Form_Sort form_Sort = new Form_Sort();
			form_Sort.Dw_Sort = Dw_Import;
			form_Sort.ShowDialog();
			Dw_Import.SetSort(Public_Data.Sort_Str);
			Dw_Import.Sort();
		}
		catch
		{
		}
	}

	private void Text_DaiBiaoShuLiang_TextChanged(object sender, EventArgs e)
	{
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShouYang.From_ShouYang));
		this.groupBox2 = new System.Windows.Forms.GroupBox();
		this.Cb_Reason = new System.Windows.Forms.ComboBox();
		this.label8 = new System.Windows.Forms.Label();
		this.dw_WWJcdw = new Sybase.DataWindow.DataWindowControl();
		this.label7 = new System.Windows.Forms.Label();
		this.label6 = new System.Windows.Forms.Label();
		this.Text_BeiZhu = new System.Windows.Forms.TextBox();
		this.label28 = new System.Windows.Forms.Label();
		this.dw_OldSampleId = new Sybase.DataWindow.DataWindowControl();
		this.Combo_JYXZ = new System.Windows.Forms.ComboBox();
		this.label1 = new System.Windows.Forms.Label();
		this.Lb_ReExam = new System.Windows.Forms.Label();
		this.Combo_Unit = new System.Windows.Forms.ComboBox();
		this.label33 = new System.Windows.Forms.Label();
		this.DTP_GetSampleDate = new System.Windows.Forms.DateTimePicker();
		this.DTP_SendSampleDate = new System.Windows.Forms.DateTimePicker();
		this.Combo_SongYangRenBianHao = new System.Windows.Forms.ComboBox();
		this.Text_QuBaoGaoShuoMing = new System.Windows.Forms.TextBox();
		this.Combo_QuBaoGaoFangShi = new System.Windows.Forms.ComboBox();
		this.label25 = new System.Windows.Forms.Label();
		this.label24 = new System.Windows.Forms.Label();
		this.label27 = new System.Windows.Forms.Label();
		this.label21 = new System.Windows.Forms.Label();
		this.Text_DaiBiaoShuLiang = new System.Windows.Forms.TextBox();
		this.label20 = new System.Windows.Forms.Label();
		this.Text_ChengJieRen = new System.Windows.Forms.TextBox();
		this.label23 = new System.Windows.Forms.Label();
		this.label30 = new System.Windows.Forms.Label();
		this.Text_ZhuShu = new System.Windows.Forms.TextBox();
		this.label19 = new System.Windows.Forms.Label();
		this.dw_Witness = new Sybase.DataWindow.DataWindowControl();
		this.dw_GetSample = new Sybase.DataWindow.DataWindowControl();
		this.label32 = new System.Windows.Forms.Label();
		this.Text_LiuZhuang = new System.Windows.Forms.TextBox();
		this.label22 = new System.Windows.Forms.Label();
		this.label26 = new System.Windows.Forms.Label();
		this.List_Xiangmu = new System.Windows.Forms.CheckedListBox();
		this.groupBox4 = new System.Windows.Forms.GroupBox();
		this.DBG_SampleTemp = new System.Windows.Forms.DataGridView();
		this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.IndexNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.SampleName = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.SpecName = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Exam_Parameter_CN = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ProJect_Part = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Exam_Quan = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ProJect_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ProJect_Name_Addon = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Deliver_Date = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Sampling_Date = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Exam_Kind = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Project_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Record_Certificate = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Total_Prices = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Area_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Witness_No = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Sampling_No = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Sending_No = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Carryon_Person = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.GetReport_Type = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.GetReport_Memo = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Memo = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Exam_Info = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.KindID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ItemID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.GradeID = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Exam_Result = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Status = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Steps = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Prince = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Molding_Date = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Delegate_Quan = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Uc_index = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.groupBox5 = new System.Windows.Forms.GroupBox();
		this.Btn_Sort = new System.Windows.Forms.Button();
		this.Btn_DownLoad = new System.Windows.Forms.Button();
		this.Btn_ModifyWeituo = new System.Windows.Forms.Button();
		this.Btn_RemoveSample = new System.Windows.Forms.Button();
		this.Btn_AddSample = new System.Windows.Forms.Button();
		this.Btn_Exit = new System.Windows.Forms.Button();
		this.Btn_Submit = new System.Windows.Forms.Button();
		this.groupBox6 = new System.Windows.Forms.GroupBox();
		this.groupBox8 = new System.Windows.Forms.GroupBox();
		this.button1 = new System.Windows.Forms.Button();
		this.label34 = new System.Windows.Forms.Label();
		this.pictureBox1 = new System.Windows.Forms.PictureBox();
		this.Dw_2 = new Sybase.DataWindow.DataWindowControl();
		this.dw_1 = new Sybase.DataWindow.DataWindowControl();
		this.TV_Sample = new System.Windows.Forms.TreeView();
		this.imageList1 = new System.Windows.Forms.ImageList(this.components);
		this.groupBox7 = new System.Windows.Forms.GroupBox();
		this.Rb_Default = new System.Windows.Forms.RadioButton();
		this.Rb_LianXu = new System.Windows.Forms.RadioButton();
		this.Cb_QuBaoGao = new System.Windows.Forms.CheckBox();
		this.Cb_LiuZhuan = new System.Windows.Forms.CheckBox();
		this.Dw_Import = new Sybase.DataWindow.DataWindowControl();
		this.groupBox1 = new System.Windows.Forms.GroupBox();
		this.Combo_QiangDuDengJi = new System.Windows.Forms.ComboBox();
		this.label29 = new System.Windows.Forms.Label();
		this.label5 = new System.Windows.Forms.Label();
		this.Combo_Guige = new System.Windows.Forms.ComboBox();
		this.Combo_YPMC = new System.Windows.Forms.ComboBox();
		this.label4 = new System.Windows.Forms.Label();
		this.Combo_YPLB = new System.Windows.Forms.ComboBox();
		this.label3 = new System.Windows.Forms.Label();
		this.Combo_JCLX = new System.Windows.Forms.ComboBox();
		this.label2 = new System.Windows.Forms.Label();
		this.Cb_Year = new System.Windows.Forms.CheckBox();
		this.Cb_ShowFinish = new System.Windows.Forms.CheckBox();
		this.groupBox2.SuspendLayout();
		this.groupBox4.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.DBG_SampleTemp).BeginInit();
		this.groupBox5.SuspendLayout();
		this.groupBox6.SuspendLayout();
		this.groupBox8.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.pictureBox1).BeginInit();
		this.groupBox7.SuspendLayout();
		this.groupBox1.SuspendLayout();
		base.SuspendLayout();
		this.groupBox2.Controls.Add(this.Cb_Reason);
		this.groupBox2.Controls.Add(this.label8);
		this.groupBox2.Controls.Add(this.dw_WWJcdw);
		this.groupBox2.Controls.Add(this.label7);
		this.groupBox2.Controls.Add(this.label6);
		this.groupBox2.Controls.Add(this.Text_BeiZhu);
		this.groupBox2.Controls.Add(this.label28);
		this.groupBox2.Controls.Add(this.dw_OldSampleId);
		this.groupBox2.Controls.Add(this.Combo_JYXZ);
		this.groupBox2.Controls.Add(this.label1);
		this.groupBox2.Controls.Add(this.Lb_ReExam);
		this.groupBox2.Controls.Add(this.Combo_Unit);
		this.groupBox2.Controls.Add(this.label33);
		this.groupBox2.Controls.Add(this.DTP_GetSampleDate);
		this.groupBox2.Controls.Add(this.DTP_SendSampleDate);
		this.groupBox2.Controls.Add(this.Combo_SongYangRenBianHao);
		this.groupBox2.Controls.Add(this.Text_QuBaoGaoShuoMing);
		this.groupBox2.Controls.Add(this.Combo_QuBaoGaoFangShi);
		this.groupBox2.Controls.Add(this.label25);
		this.groupBox2.Controls.Add(this.label24);
		this.groupBox2.Controls.Add(this.label27);
		this.groupBox2.Controls.Add(this.label21);
		this.groupBox2.Controls.Add(this.Text_DaiBiaoShuLiang);
		this.groupBox2.Controls.Add(this.label20);
		this.groupBox2.Controls.Add(this.Text_ChengJieRen);
		this.groupBox2.Controls.Add(this.label23);
		this.groupBox2.Controls.Add(this.label30);
		this.groupBox2.Controls.Add(this.Text_ZhuShu);
		this.groupBox2.Controls.Add(this.label19);
		this.groupBox2.Controls.Add(this.dw_Witness);
		this.groupBox2.Controls.Add(this.dw_GetSample);
		this.groupBox2.Controls.Add(this.label32);
		this.groupBox2.Controls.Add(this.Text_LiuZhuang);
		this.groupBox2.Controls.Add(this.label22);
		this.groupBox2.Controls.Add(this.label26);
		this.groupBox2.Location = new System.Drawing.Point(227, 400);
		this.groupBox2.Name = "groupBox2";
		this.groupBox2.Size = new System.Drawing.Size(415, 268);
		this.groupBox2.TabIndex = 4;
		this.groupBox2.TabStop = false;
		this.groupBox2.Text = "检测信息";
		this.Cb_Reason.FormattingEnabled = true;
		this.Cb_Reason.Items.AddRange(new object[3] { "无检测资质外委", "设备损坏无法检测", "其它原因" });
		this.Cb_Reason.Location = new System.Drawing.Point(107, 95);
		this.Cb_Reason.Name = "Cb_Reason";
		this.Cb_Reason.Size = new System.Drawing.Size(229, 20);
		this.Cb_Reason.TabIndex = 61;
		this.Cb_Reason.Text = "无检测资质外委";
		this.label8.AutoSize = true;
		this.label8.Location = new System.Drawing.Point(51, 97);
		this.label8.Name = "label8";
		this.label8.Size = new System.Drawing.Size(53, 12);
		this.label8.TabIndex = 60;
		this.label8.Text = "外委原因";
		this.dw_WWJcdw.DataWindowObject = "";
		this.dw_WWJcdw.Enabled = false;
		this.dw_WWJcdw.LibraryList = "";
		this.dw_WWJcdw.Location = new System.Drawing.Point(107, 65);
		this.dw_WWJcdw.Name = "dw_WWJcdw";
		this.dw_WWJcdw.Size = new System.Drawing.Size(229, 24);
		this.dw_WWJcdw.TabIndex = 59;
		this.dw_WWJcdw.Text = "dataWindowControl1";
		this.label7.AutoSize = true;
		this.label7.Location = new System.Drawing.Point(4, 70);
		this.label7.Name = "label7";
		this.label7.Size = new System.Drawing.Size(101, 12);
		this.label7.TabIndex = 58;
		this.label7.Text = "外委检测单位选择";
		this.label6.AutoSize = true;
		this.label6.Location = new System.Drawing.Point(33, 69);
		this.label6.Name = "label6";
		this.label6.Size = new System.Drawing.Size(0, 12);
		this.label6.TabIndex = 57;
		this.Text_BeiZhu.Location = new System.Drawing.Point(71, 123);
		this.Text_BeiZhu.Multiline = true;
		this.Text_BeiZhu.Name = "Text_BeiZhu";
		this.Text_BeiZhu.Size = new System.Drawing.Size(342, 131);
		this.Text_BeiZhu.TabIndex = 53;
		this.label28.AutoSize = true;
		this.label28.Location = new System.Drawing.Point(34, 129);
		this.label28.Name = "label28";
		this.label28.Size = new System.Drawing.Size(29, 12);
		this.label28.TabIndex = 55;
		this.label28.Text = "备注";
		this.dw_OldSampleId.DataWindowObject = "";
		this.dw_OldSampleId.Enabled = false;
		this.dw_OldSampleId.LibraryList = "";
		this.dw_OldSampleId.Location = new System.Drawing.Point(107, 40);
		this.dw_OldSampleId.Name = "dw_OldSampleId";
		this.dw_OldSampleId.Size = new System.Drawing.Size(141, 21);
		this.dw_OldSampleId.TabIndex = 50;
		this.dw_OldSampleId.Text = "dataWindowControl1";
		this.Combo_JYXZ.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.Combo_JYXZ.FormattingEnabled = true;
		this.Combo_JYXZ.Items.AddRange(new object[3] { "取样", "复验", "外委" });
		this.Combo_JYXZ.Location = new System.Drawing.Point(68, 16);
		this.Combo_JYXZ.Name = "Combo_JYXZ";
		this.Combo_JYXZ.Size = new System.Drawing.Size(86, 20);
		this.Combo_JYXZ.TabIndex = 13;
		this.Combo_JYXZ.SelectedIndexChanged += new System.EventHandler(Combo_JYXZ_SelectedIndexChanged);
		this.label1.AutoSize = true;
		this.label1.Location = new System.Drawing.Point(10, 19);
		this.label1.Name = "label1";
		this.label1.Size = new System.Drawing.Size(53, 12);
		this.label1.TabIndex = 12;
		this.label1.Text = "检验性质";
		this.Lb_ReExam.Enabled = false;
		this.Lb_ReExam.Location = new System.Drawing.Point(15, 44);
		this.Lb_ReExam.Name = "Lb_ReExam";
		this.Lb_ReExam.Size = new System.Drawing.Size(89, 16);
		this.Lb_ReExam.TabIndex = 49;
		this.Lb_ReExam.Text = "复验原样品编号";
		this.Combo_Unit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
		this.Combo_Unit.Items.AddRange(new object[3] { "立方米", "吨", "块" });
		this.Combo_Unit.Location = new System.Drawing.Point(460, 17);
		this.Combo_Unit.Name = "Combo_Unit";
		this.Combo_Unit.Size = new System.Drawing.Size(69, 20);
		this.Combo_Unit.TabIndex = 13;
		this.Combo_Unit.Visible = false;
		this.Combo_Unit.KeyDown += new System.Windows.Forms.KeyEventHandler(Combo_Unit_KeyDown);
		this.label33.AutoSize = true;
		this.label33.Location = new System.Drawing.Point(431, 20);
		this.label33.Name = "label33";
		this.label33.Size = new System.Drawing.Size(29, 12);
		this.label33.TabIndex = 48;
		this.label33.Text = "单位";
		this.label33.Visible = false;
		this.DTP_GetSampleDate.Location = new System.Drawing.Point(217, 16);
		this.DTP_GetSampleDate.Name = "DTP_GetSampleDate";
		this.DTP_GetSampleDate.Size = new System.Drawing.Size(121, 21);
		this.DTP_GetSampleDate.TabIndex = 15;
		this.DTP_GetSampleDate.KeyDown += new System.Windows.Forms.KeyEventHandler(DTP_GetSampleDate_KeyDown);
		this.DTP_SendSampleDate.Location = new System.Drawing.Point(68, 42);
		this.DTP_SendSampleDate.Name = "DTP_SendSampleDate";
		this.DTP_SendSampleDate.Size = new System.Drawing.Size(131, 21);
		this.DTP_SendSampleDate.TabIndex = 14;
		this.DTP_SendSampleDate.Visible = false;
		this.DTP_SendSampleDate.KeyDown += new System.Windows.Forms.KeyEventHandler(DTP_SendSampleDate_KeyDown);
		this.Combo_SongYangRenBianHao.FormattingEnabled = true;
		this.Combo_SongYangRenBianHao.Location = new System.Drawing.Point(277, 172);
		this.Combo_SongYangRenBianHao.Name = "Combo_SongYangRenBianHao";
		this.Combo_SongYangRenBianHao.Size = new System.Drawing.Size(121, 20);
		this.Combo_SongYangRenBianHao.TabIndex = 18;
		this.Combo_SongYangRenBianHao.Visible = false;
		this.Combo_SongYangRenBianHao.KeyDown += new System.Windows.Forms.KeyEventHandler(Combo_SongYangRenBianHao_KeyDown);
		this.Text_QuBaoGaoShuoMing.Location = new System.Drawing.Point(467, 97);
		this.Text_QuBaoGaoShuoMing.Name = "Text_QuBaoGaoShuoMing";
		this.Text_QuBaoGaoShuoMing.Size = new System.Drawing.Size(112, 21);
		this.Text_QuBaoGaoShuoMing.TabIndex = 21;
		this.Text_QuBaoGaoShuoMing.Visible = false;
		this.Text_QuBaoGaoShuoMing.KeyDown += new System.Windows.Forms.KeyEventHandler(Text_QuBaoGaoShuoMing_KeyDown);
		this.Combo_QuBaoGaoFangShi.FormattingEnabled = true;
		this.Combo_QuBaoGaoFangShi.Items.AddRange(new object[3] { "自取", "邮寄", "其它" });
		this.Combo_QuBaoGaoFangShi.Location = new System.Drawing.Point(277, 198);
		this.Combo_QuBaoGaoFangShi.Name = "Combo_QuBaoGaoFangShi";
		this.Combo_QuBaoGaoFangShi.Size = new System.Drawing.Size(121, 20);
		this.Combo_QuBaoGaoFangShi.TabIndex = 20;
		this.Combo_QuBaoGaoFangShi.Visible = false;
		this.Combo_QuBaoGaoFangShi.KeyDown += new System.Windows.Forms.KeyEventHandler(Combo_QuBaoGaoFangShi_KeyDown);
		this.label25.AutoSize = true;
		this.label25.Location = new System.Drawing.Point(395, 100);
		this.label25.Name = "label25";
		this.label25.Size = new System.Drawing.Size(65, 12);
		this.label25.TabIndex = 38;
		this.label25.Text = "取报告说明";
		this.label25.Visible = false;
		this.label24.AutoSize = true;
		this.label24.Location = new System.Drawing.Point(212, 201);
		this.label24.Name = "label24";
		this.label24.Size = new System.Drawing.Size(65, 12);
		this.label24.TabIndex = 36;
		this.label24.Text = "取报告方式";
		this.label24.Visible = false;
		this.label27.AutoSize = true;
		this.label27.Location = new System.Drawing.Point(9, 194);
		this.label27.Name = "label27";
		this.label27.Size = new System.Drawing.Size(65, 12);
		this.label27.TabIndex = 46;
		this.label27.Text = "见证人编号";
		this.label27.Visible = false;
		this.label21.AutoSize = true;
		this.label21.Location = new System.Drawing.Point(10, 46);
		this.label21.Name = "label21";
		this.label21.Size = new System.Drawing.Size(53, 12);
		this.label21.TabIndex = 43;
		this.label21.Text = "送样日期";
		this.label21.Visible = false;
		this.Text_DaiBiaoShuLiang.Location = new System.Drawing.Point(340, 16);
		this.Text_DaiBiaoShuLiang.Name = "Text_DaiBiaoShuLiang";
		this.Text_DaiBiaoShuLiang.Size = new System.Drawing.Size(90, 21);
		this.Text_DaiBiaoShuLiang.TabIndex = 12;
		this.Text_DaiBiaoShuLiang.Visible = false;
		this.Text_DaiBiaoShuLiang.TextChanged += new System.EventHandler(Text_DaiBiaoShuLiang_TextChanged);
		this.Text_DaiBiaoShuLiang.Enter += new System.EventHandler(Text_DaiBiaoShuLiang_Enter);
		this.Text_DaiBiaoShuLiang.KeyDown += new System.Windows.Forms.KeyEventHandler(Text_DaiBiaoShuLiang_KeyDown);
		this.Text_DaiBiaoShuLiang.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Text_DaiBiaoShuLiang_KeyPress);
		this.Text_DaiBiaoShuLiang.Leave += new System.EventHandler(Text_DaiBiaoShuLiang_Leave);
		this.label20.AutoSize = true;
		this.label20.Location = new System.Drawing.Point(402, 74);
		this.label20.Name = "label20";
		this.label20.Size = new System.Drawing.Size(65, 12);
		this.label20.TabIndex = 28;
		this.label20.Text = "取样人编号";
		this.label20.Visible = false;
		this.Text_ChengJieRen.Location = new System.Drawing.Point(64, 225);
		this.Text_ChengJieRen.Name = "Text_ChengJieRen";
		this.Text_ChengJieRen.Size = new System.Drawing.Size(130, 21);
		this.Text_ChengJieRen.TabIndex = 16;
		this.Text_ChengJieRen.Visible = false;
		this.Text_ChengJieRen.KeyDown += new System.Windows.Forms.KeyEventHandler(Text_ChengJieRen_KeyDown);
		this.label23.AutoSize = true;
		this.label23.Location = new System.Drawing.Point(17, 228);
		this.label23.Name = "label23";
		this.label23.Size = new System.Drawing.Size(41, 12);
		this.label23.TabIndex = 34;
		this.label23.Text = "承接人";
		this.label23.Visible = false;
		this.label30.AutoSize = true;
		this.label30.Location = new System.Drawing.Point(283, 20);
		this.label30.Name = "label30";
		this.label30.Size = new System.Drawing.Size(53, 12);
		this.label30.TabIndex = 13;
		this.label30.Text = "代表数量";
		this.label30.Visible = false;
		this.Text_ZhuShu.Location = new System.Drawing.Point(195, 16);
		this.Text_ZhuShu.Name = "Text_ZhuShu";
		this.Text_ZhuShu.Size = new System.Drawing.Size(79, 21);
		this.Text_ZhuShu.TabIndex = 11;
		this.Text_ZhuShu.Text = "1";
		this.Text_ZhuShu.Visible = false;
		this.Text_ZhuShu.TextChanged += new System.EventHandler(Text_ZhuShu_TextChanged);
		this.Text_ZhuShu.KeyDown += new System.Windows.Forms.KeyEventHandler(Text_ZhuShu_KeyDown);
		this.Text_ZhuShu.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Text_ZhuShu_KeyPress);
		this.label19.AutoSize = true;
		this.label19.Location = new System.Drawing.Point(212, 175);
		this.label19.Name = "label19";
		this.label19.Size = new System.Drawing.Size(65, 12);
		this.label19.TabIndex = 22;
		this.label19.Text = "送样人编号";
		this.label19.Visible = false;
		this.dw_Witness.DataWindowObject = "";
		this.dw_Witness.LibraryList = "";
		this.dw_Witness.Location = new System.Drawing.Point(80, 188);
		this.dw_Witness.Name = "dw_Witness";
		this.dw_Witness.Size = new System.Drawing.Size(131, 22);
		this.dw_Witness.TabIndex = 17;
		this.dw_Witness.Text = "dataWindowControl1";
		this.dw_Witness.Visible = false;
		this.dw_Witness.Leave += new System.EventHandler(dw_Witness_Leave);
		this.dw_GetSample.DataWindowObject = "";
		this.dw_GetSample.LibraryList = "";
		this.dw_GetSample.Location = new System.Drawing.Point(467, 69);
		this.dw_GetSample.Name = "dw_GetSample";
		this.dw_GetSample.Size = new System.Drawing.Size(112, 22);
		this.dw_GetSample.TabIndex = 19;
		this.dw_GetSample.Text = "dataWindowControl1";
		this.dw_GetSample.Visible = false;
		this.dw_GetSample.Leave += new System.EventHandler(dw_GetSample_Leave);
		this.label32.AutoSize = true;
		this.label32.Location = new System.Drawing.Point(204, 228);
		this.label32.Name = "label32";
		this.label32.Size = new System.Drawing.Size(53, 12);
		this.label32.TabIndex = 56;
		this.label32.Text = "流转信息";
		this.label32.Visible = false;
		this.Text_LiuZhuang.Location = new System.Drawing.Point(258, 225);
		this.Text_LiuZhuang.Name = "Text_LiuZhuang";
		this.Text_LiuZhuang.Size = new System.Drawing.Size(250, 21);
		this.Text_LiuZhuang.TabIndex = 54;
		this.Text_LiuZhuang.Visible = false;
		this.label22.AutoSize = true;
		this.label22.Location = new System.Drawing.Point(158, 20);
		this.label22.Name = "label22";
		this.label22.Size = new System.Drawing.Size(53, 12);
		this.label22.TabIndex = 44;
		this.label22.Text = "取样日期";
		this.label26.AutoSize = true;
		this.label26.Location = new System.Drawing.Point(161, 20);
		this.label26.Name = "label26";
		this.label26.Size = new System.Drawing.Size(29, 12);
		this.label26.TabIndex = 9;
		this.label26.Text = "组数";
		this.label26.Visible = false;
		this.List_Xiangmu.CheckOnClick = true;
		this.List_Xiangmu.FormattingEnabled = true;
		this.List_Xiangmu.Location = new System.Drawing.Point(817, 13);
		this.List_Xiangmu.Name = "List_Xiangmu";
		this.List_Xiangmu.Size = new System.Drawing.Size(189, 372);
		this.List_Xiangmu.TabIndex = 6;
		this.groupBox4.Controls.Add(this.DBG_SampleTemp);
		this.groupBox4.Location = new System.Drawing.Point(227, 400);
		this.groupBox4.Name = "groupBox4";
		this.groupBox4.Size = new System.Drawing.Size(421, 268);
		this.groupBox4.TabIndex = 7;
		this.groupBox4.TabStop = false;
		this.groupBox4.Text = "已收样品列表";
		this.groupBox4.Visible = false;
		this.DBG_SampleTemp.AllowUserToAddRows = false;
		this.DBG_SampleTemp.AllowUserToDeleteRows = false;
		this.DBG_SampleTemp.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
		this.DBG_SampleTemp.Columns.AddRange(this.ID, this.IndexNo, this.SampleName, this.SpecName, this.Exam_Parameter_CN, this.ProJect_Part, this.Exam_Quan, this.ProJect_Name, this.ProJect_Name_Addon, this.Deliver_Date, this.Sampling_Date, this.Exam_Kind, this.Project_ID, this.Record_Certificate, this.Total_Prices, this.Area_ID, this.Witness_No, this.Sampling_No, this.Sending_No, this.Carryon_Person, this.GetReport_Type, this.GetReport_Memo, this.Memo, this.Exam_Info, this.KindID, this.ItemID, this.GradeID, this.Exam_Result, this.Status, this.Steps, this.Prince, this.Molding_Date, this.Delegate_Quan, this.Uc_index);
		this.DBG_SampleTemp.GridColor = System.Drawing.SystemColors.GradientActiveCaption;
		this.DBG_SampleTemp.Location = new System.Drawing.Point(6, 18);
		this.DBG_SampleTemp.Name = "DBG_SampleTemp";
		this.DBG_SampleTemp.ReadOnly = true;
		this.DBG_SampleTemp.RowTemplate.Height = 23;
		this.DBG_SampleTemp.Size = new System.Drawing.Size(407, 245);
		this.DBG_SampleTemp.TabIndex = 0;
		this.DBG_SampleTemp.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(DBG_SampleTemp_CellClick);
		this.DBG_SampleTemp.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(DBG_SampleTemp_CellContentClick);
		this.DBG_SampleTemp.Leave += new System.EventHandler(DBG_SampleTemp_Leave);
		this.ID.DataPropertyName = "ID";
		this.ID.HeaderText = "检测序号";
		this.ID.Name = "ID";
		this.ID.ReadOnly = true;
		this.ID.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ID.Visible = false;
		this.ID.Width = 80;
		this.IndexNo.DataPropertyName = "IndexNo";
		this.IndexNo.HeaderText = "索引";
		this.IndexNo.Name = "IndexNo";
		this.IndexNo.ReadOnly = true;
		this.IndexNo.Visible = false;
		this.SampleName.DataPropertyName = "SampleName";
		this.SampleName.HeaderText = "样品名称";
		this.SampleName.Name = "SampleName";
		this.SampleName.ReadOnly = true;
		this.SampleName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.SpecName.DataPropertyName = "SpecName";
		this.SpecName.HeaderText = "规格";
		this.SpecName.Name = "SpecName";
		this.SpecName.ReadOnly = true;
		this.SpecName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.Exam_Parameter_CN.DataPropertyName = "Exam_Parameter_CN";
		this.Exam_Parameter_CN.HeaderText = "检测参数";
		this.Exam_Parameter_CN.Name = "Exam_Parameter_CN";
		this.Exam_Parameter_CN.ReadOnly = true;
		this.ProJect_Part.DataPropertyName = "ProJect_Part";
		this.ProJect_Part.HeaderText = "工程部位";
		this.ProJect_Part.Name = "ProJect_Part";
		this.ProJect_Part.ReadOnly = true;
		this.Exam_Quan.DataPropertyName = "Exam_Quan";
		this.Exam_Quan.HeaderText = "检测数量";
		this.Exam_Quan.Name = "Exam_Quan";
		this.Exam_Quan.ReadOnly = true;
		this.Exam_Quan.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ProJect_Name.DataPropertyName = "ProJect_Name";
		this.ProJect_Name.HeaderText = "工程名称";
		this.ProJect_Name.Name = "ProJect_Name";
		this.ProJect_Name.ReadOnly = true;
		this.ProJect_Name.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.ProJect_Name_Addon.DataPropertyName = "ProJect_Name_Addon";
		this.ProJect_Name_Addon.HeaderText = "附加工程名称";
		this.ProJect_Name_Addon.Name = "ProJect_Name_Addon";
		this.ProJect_Name_Addon.ReadOnly = true;
		this.ProJect_Name_Addon.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.Deliver_Date.DataPropertyName = "Deliver_Date";
		this.Deliver_Date.HeaderText = "送样日期";
		this.Deliver_Date.Name = "Deliver_Date";
		this.Deliver_Date.ReadOnly = true;
		this.Sampling_Date.DataPropertyName = "Sampling_Date";
		this.Sampling_Date.HeaderText = "取样日期";
		this.Sampling_Date.Name = "Sampling_Date";
		this.Sampling_Date.ReadOnly = true;
		this.Exam_Kind.DataPropertyName = "Exam_Kind";
		this.Exam_Kind.HeaderText = "检验性质";
		this.Exam_Kind.Name = "Exam_Kind";
		this.Exam_Kind.ReadOnly = true;
		this.Project_ID.DataPropertyName = "Project_ID";
		this.Project_ID.HeaderText = "工程编号";
		this.Project_ID.Name = "Project_ID";
		this.Project_ID.ReadOnly = true;
		this.Record_Certificate.DataPropertyName = "Record_Certificate";
		this.Record_Certificate.HeaderText = "备案证编号";
		this.Record_Certificate.Name = "Record_Certificate";
		this.Record_Certificate.ReadOnly = true;
		this.Record_Certificate.Visible = false;
		this.Total_Prices.DataPropertyName = "Total_Prices";
		this.Total_Prices.HeaderText = "总价";
		this.Total_Prices.Name = "Total_Prices";
		this.Total_Prices.ReadOnly = true;
		this.Total_Prices.Visible = false;
		this.Area_ID.DataPropertyName = "Area_ID";
		this.Area_ID.HeaderText = "所属区县编号";
		this.Area_ID.Name = "Area_ID";
		this.Area_ID.ReadOnly = true;
		this.Area_ID.Visible = false;
		this.Witness_No.DataPropertyName = "Witness_No";
		this.Witness_No.HeaderText = "见证人编号";
		this.Witness_No.Name = "Witness_No";
		this.Witness_No.ReadOnly = true;
		this.Witness_No.Visible = false;
		this.Sampling_No.DataPropertyName = "Sampling_No";
		this.Sampling_No.HeaderText = "取样人编号";
		this.Sampling_No.Name = "Sampling_No";
		this.Sampling_No.ReadOnly = true;
		this.Sampling_No.Visible = false;
		this.Sending_No.DataPropertyName = "Sending_No";
		this.Sending_No.HeaderText = "送样人编号";
		this.Sending_No.Name = "Sending_No";
		this.Sending_No.ReadOnly = true;
		this.Sending_No.Visible = false;
		this.Carryon_Person.DataPropertyName = "Carryon_Person";
		this.Carryon_Person.HeaderText = "承接人";
		this.Carryon_Person.Name = "Carryon_Person";
		this.Carryon_Person.ReadOnly = true;
		this.GetReport_Type.DataPropertyName = "GetReport_Type";
		this.GetReport_Type.HeaderText = "取报告方式";
		this.GetReport_Type.Name = "GetReport_Type";
		this.GetReport_Type.ReadOnly = true;
		this.GetReport_Memo.DataPropertyName = "GetReport_Memo";
		this.GetReport_Memo.HeaderText = "取报告说明";
		this.GetReport_Memo.Name = "GetReport_Memo";
		this.GetReport_Memo.ReadOnly = true;
		this.Memo.DataPropertyName = "Memo";
		this.Memo.HeaderText = "备注";
		this.Memo.Name = "Memo";
		this.Memo.ReadOnly = true;
		this.Exam_Info.DataPropertyName = "Exam_Info";
		this.Exam_Info.HeaderText = "流转信息";
		this.Exam_Info.Name = "Exam_Info";
		this.Exam_Info.ReadOnly = true;
		this.KindID.DataPropertyName = "KindID";
		this.KindID.HeaderText = "检测类型编号";
		this.KindID.Name = "KindID";
		this.KindID.ReadOnly = true;
		this.ItemID.DataPropertyName = "ItemID";
		this.ItemID.HeaderText = "样品类别编号";
		this.ItemID.Name = "ItemID";
		this.ItemID.ReadOnly = true;
		this.GradeID.DataPropertyName = "GradeID";
		this.GradeID.HeaderText = "强度等级编号";
		this.GradeID.Name = "GradeID";
		this.GradeID.ReadOnly = true;
		this.Exam_Result.DataPropertyName = "Exam_Result";
		this.Exam_Result.HeaderText = "检验结果";
		this.Exam_Result.Name = "Exam_Result";
		this.Exam_Result.ReadOnly = true;
		this.Exam_Result.Visible = false;
		this.Status.DataPropertyName = "Status";
		this.Status.HeaderText = "试验状态";
		this.Status.Name = "Status";
		this.Status.ReadOnly = true;
		this.Status.Visible = false;
		this.Steps.DataPropertyName = "Steps";
		this.Steps.HeaderText = "步骤";
		this.Steps.Name = "Steps";
		this.Steps.ReadOnly = true;
		this.Steps.Visible = false;
		this.Prince.DataPropertyName = "Prince";
		this.Prince.HeaderText = "样品单价";
		this.Prince.Name = "Prince";
		this.Prince.ReadOnly = true;
		this.Prince.Visible = false;
		this.Molding_Date.DataPropertyName = "Molding_Date";
		this.Molding_Date.HeaderText = "成型日期";
		this.Molding_Date.Name = "Molding_Date";
		this.Molding_Date.ReadOnly = true;
		this.Delegate_Quan.DataPropertyName = "Delegate_Quan";
		this.Delegate_Quan.HeaderText = "代表数量";
		this.Delegate_Quan.Name = "Delegate_Quan";
		this.Delegate_Quan.ReadOnly = true;
		this.Uc_index.DataPropertyName = "Uc_index";
		this.Uc_index.HeaderText = "UC序列";
		this.Uc_index.Name = "Uc_index";
		this.Uc_index.ReadOnly = true;
		this.Uc_index.Visible = false;
		this.groupBox5.Controls.Add(this.Btn_Sort);
		this.groupBox5.Controls.Add(this.Btn_DownLoad);
		this.groupBox5.Controls.Add(this.Btn_ModifyWeituo);
		this.groupBox5.Controls.Add(this.Btn_RemoveSample);
		this.groupBox5.Controls.Add(this.Btn_AddSample);
		this.groupBox5.Controls.Add(this.Btn_Exit);
		this.groupBox5.Controls.Add(this.Btn_Submit);
		this.groupBox5.Location = new System.Drawing.Point(227, 668);
		this.groupBox5.Name = "groupBox5";
		this.groupBox5.Size = new System.Drawing.Size(781, 49);
		this.groupBox5.TabIndex = 8;
		this.groupBox5.TabStop = false;
		this.Btn_Sort.Location = new System.Drawing.Point(401, 13);
		this.Btn_Sort.Name = "Btn_Sort";
		this.Btn_Sort.Size = new System.Drawing.Size(90, 29);
		this.Btn_Sort.TabIndex = 7;
		this.Btn_Sort.Text = "排序";
		this.Btn_Sort.UseVisualStyleBackColor = true;
		this.Btn_Sort.Click += new System.EventHandler(Btn_Sort_Click);
		this.Btn_DownLoad.Location = new System.Drawing.Point(6, 12);
		this.Btn_DownLoad.Name = "Btn_DownLoad";
		this.Btn_DownLoad.Size = new System.Drawing.Size(90, 29);
		this.Btn_DownLoad.TabIndex = 6;
		this.Btn_DownLoad.Text = "下载参数信息";
		this.Btn_DownLoad.UseVisualStyleBackColor = true;
		this.Btn_DownLoad.Visible = false;
		this.Btn_DownLoad.Click += new System.EventHandler(Btn_DownLoad_Click);
		this.Btn_ModifyWeituo.Location = new System.Drawing.Point(493, 13);
		this.Btn_ModifyWeituo.Name = "Btn_ModifyWeituo";
		this.Btn_ModifyWeituo.Size = new System.Drawing.Size(100, 29);
		this.Btn_ModifyWeituo.TabIndex = 4;
		this.Btn_ModifyWeituo.Text = "查看修改委托单";
		this.Btn_ModifyWeituo.UseVisualStyleBackColor = true;
		this.Btn_ModifyWeituo.Click += new System.EventHandler(Btn_ModifyWeituo_Click);
		this.Btn_RemoveSample.Location = new System.Drawing.Point(510, 13);
		this.Btn_RemoveSample.Name = "Btn_RemoveSample";
		this.Btn_RemoveSample.Size = new System.Drawing.Size(83, 29);
		this.Btn_RemoveSample.TabIndex = 3;
		this.Btn_RemoveSample.Text = "移除样品";
		this.Btn_RemoveSample.UseVisualStyleBackColor = true;
		this.Btn_RemoveSample.Visible = false;
		this.Btn_RemoveSample.Click += new System.EventHandler(Btn_RemoveSample_Click);
		this.Btn_AddSample.Location = new System.Drawing.Point(387, 13);
		this.Btn_AddSample.Name = "Btn_AddSample";
		this.Btn_AddSample.Size = new System.Drawing.Size(121, 29);
		this.Btn_AddSample.TabIndex = 2;
		this.Btn_AddSample.Text = "添加样品到收样列表";
		this.Btn_AddSample.UseVisualStyleBackColor = true;
		this.Btn_AddSample.Visible = false;
		this.Btn_AddSample.Click += new System.EventHandler(Btn_AddSample_Click);
		this.Btn_Exit.Location = new System.Drawing.Point(691, 13);
		this.Btn_Exit.Name = "Btn_Exit";
		this.Btn_Exit.Size = new System.Drawing.Size(85, 29);
		this.Btn_Exit.TabIndex = 1;
		this.Btn_Exit.Text = "放弃(新委托)";
		this.Btn_Exit.UseVisualStyleBackColor = true;
		this.Btn_Exit.Click += new System.EventHandler(Btn_Exit_Click);
		this.Btn_Submit.Location = new System.Drawing.Point(595, 13);
		this.Btn_Submit.Name = "Btn_Submit";
		this.Btn_Submit.Size = new System.Drawing.Size(94, 29);
		this.Btn_Submit.TabIndex = 0;
		this.Btn_Submit.Text = "提交样品信息";
		this.Btn_Submit.UseVisualStyleBackColor = true;
		this.Btn_Submit.Click += new System.EventHandler(Btn_Submit_Click);
		this.groupBox6.Controls.Add(this.groupBox8);
		this.groupBox6.Controls.Add(this.Dw_2);
		this.groupBox6.Controls.Add(this.dw_1);
		this.groupBox6.Location = new System.Drawing.Point(648, 400);
		this.groupBox6.Name = "groupBox6";
		this.groupBox6.Size = new System.Drawing.Size(359, 268);
		this.groupBox6.TabIndex = 9;
		this.groupBox6.TabStop = false;
		this.groupBox6.Text = "样品信息";
		this.groupBox8.Controls.Add(this.button1);
		this.groupBox8.Controls.Add(this.label34);
		this.groupBox8.Controls.Add(this.pictureBox1);
		this.groupBox8.Location = new System.Drawing.Point(7, 217);
		this.groupBox8.Name = "groupBox8";
		this.groupBox8.Size = new System.Drawing.Size(345, 44);
		this.groupBox8.TabIndex = 27;
		this.groupBox8.TabStop = false;
		this.groupBox8.Visible = false;
		this.button1.Location = new System.Drawing.Point(242, 17);
		this.button1.Name = "button1";
		this.button1.Size = new System.Drawing.Size(57, 21);
		this.button1.TabIndex = 4;
		this.button1.Text = "button1";
		this.button1.UseVisualStyleBackColor = true;
		this.button1.Visible = false;
		this.button1.Click += new System.EventHandler(button1_Click_1);
		this.label34.AutoSize = true;
		this.label34.Location = new System.Drawing.Point(13, 17);
		this.label34.Name = "label34";
		this.label34.Size = new System.Drawing.Size(125, 12);
		this.label34.TabIndex = 3;
		this.label34.Text = "钢筋表面标识图片预览";
		this.pictureBox1.Location = new System.Drawing.Point(154, 8);
		this.pictureBox1.Name = "pictureBox1";
		this.pictureBox1.Size = new System.Drawing.Size(34, 32);
		this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
		this.pictureBox1.TabIndex = 2;
		this.pictureBox1.TabStop = false;
		this.Dw_2.DataWindowObject = "";
		this.Dw_2.LibraryList = "";
		this.Dw_2.Location = new System.Drawing.Point(74, 70);
		this.Dw_2.Name = "Dw_2";
		this.Dw_2.Size = new System.Drawing.Size(76, 69);
		this.Dw_2.TabIndex = 2;
		this.Dw_2.Text = "dataWindowControl1";
		this.Dw_2.Visible = false;
		this.dw_1.DataWindowObject = "";
		this.dw_1.LibraryList = "";
		this.dw_1.Location = new System.Drawing.Point(6, 15);
		this.dw_1.Name = "dw_1";
		this.dw_1.Size = new System.Drawing.Size(348, 248);
		this.dw_1.TabIndex = 26;
		this.dw_1.Text = "dataWindowControl1";
		this.TV_Sample.ImageIndex = 0;
		this.TV_Sample.ImageList = this.imageList1;
		this.TV_Sample.Location = new System.Drawing.Point(-1, 0);
		this.TV_Sample.Name = "TV_Sample";
		this.TV_Sample.SelectedImageIndex = 0;
		this.TV_Sample.Size = new System.Drawing.Size(222, 667);
		this.TV_Sample.TabIndex = 10;
		this.TV_Sample.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(TV_Sample_AfterSelect);
		this.TV_Sample.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(TV_Sample_NodeMouseClick);
		this.imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
		this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
		this.imageList1.Images.SetKeyName(0, "Kind.jpg");
		this.imageList1.Images.SetKeyName(1, "Item.jpg");
		this.imageList1.Images.SetKeyName(2, "Sample.jpg");
		this.imageList1.Images.SetKeyName(3, "Kind_back.jpg");
		this.imageList1.Images.SetKeyName(4, "Item_back.jpg");
		this.imageList1.Images.SetKeyName(5, "Sample_back.jpg");
		this.groupBox7.Controls.Add(this.Rb_Default);
		this.groupBox7.Controls.Add(this.Rb_LianXu);
		this.groupBox7.Controls.Add(this.Cb_QuBaoGao);
		this.groupBox7.Controls.Add(this.Cb_LiuZhuan);
		this.groupBox7.Location = new System.Drawing.Point(9, 564);
		this.groupBox7.Name = "groupBox7";
		this.groupBox7.Size = new System.Drawing.Size(218, 49);
		this.groupBox7.TabIndex = 11;
		this.groupBox7.TabStop = false;
		this.groupBox7.Text = "打印设置";
		this.groupBox7.Visible = false;
		this.Rb_Default.AutoSize = true;
		this.Rb_Default.Location = new System.Drawing.Point(103, 30);
		this.Rb_Default.Name = "Rb_Default";
		this.Rb_Default.Size = new System.Drawing.Size(95, 16);
		this.Rb_Default.TabIndex = 3;
		this.Rb_Default.TabStop = true;
		this.Rb_Default.Text = "默认A5打印纸";
		this.Rb_Default.UseVisualStyleBackColor = true;
		this.Rb_LianXu.AutoSize = true;
		this.Rb_LianXu.Checked = true;
		this.Rb_LianXu.Location = new System.Drawing.Point(11, 30);
		this.Rb_LianXu.Name = "Rb_LianXu";
		this.Rb_LianXu.Size = new System.Drawing.Size(95, 16);
		this.Rb_LianXu.TabIndex = 2;
		this.Rb_LianXu.TabStop = true;
		this.Rb_LianXu.Text = "连续A5打印纸";
		this.Rb_LianXu.UseVisualStyleBackColor = true;
		this.Cb_QuBaoGao.AutoSize = true;
		this.Cb_QuBaoGao.Location = new System.Drawing.Point(102, 13);
		this.Cb_QuBaoGao.Name = "Cb_QuBaoGao";
		this.Cb_QuBaoGao.Size = new System.Drawing.Size(108, 16);
		this.Cb_QuBaoGao.TabIndex = 1;
		this.Cb_QuBaoGao.Text = "打印取报告凭证";
		this.Cb_QuBaoGao.UseVisualStyleBackColor = true;
		this.Cb_LiuZhuan.AutoSize = true;
		this.Cb_LiuZhuan.Location = new System.Drawing.Point(12, 12);
		this.Cb_LiuZhuan.Name = "Cb_LiuZhuan";
		this.Cb_LiuZhuan.Size = new System.Drawing.Size(84, 16);
		this.Cb_LiuZhuan.TabIndex = 0;
		this.Cb_LiuZhuan.Text = "打印流转单";
		this.Cb_LiuZhuan.UseVisualStyleBackColor = true;
		this.Cb_LiuZhuan.CheckedChanged += new System.EventHandler(Cb_LiuZhuan_CheckedChanged);
		this.Dw_Import.DataWindowObject = "";
		this.Dw_Import.LibraryList = "";
		this.Dw_Import.Location = new System.Drawing.Point(230, 12);
		this.Dw_Import.Name = "Dw_Import";
		this.Dw_Import.ScrollBars = Sybase.DataWindow.DataWindowScrollBars.VerticalAndHorizontalSplit;
		this.Dw_Import.Size = new System.Drawing.Size(578, 307);
		this.Dw_Import.TabIndex = 14;
		this.Dw_Import.Text = "dataWindowControl1";
		this.Dw_Import.ItemChanged += new Sybase.DataWindow.ItemChangedEventHandler(Dw_Import_ItemChanged);
		this.Dw_Import.RowFocusChanged += new Sybase.DataWindow.RowFocusChangedEventHandler(Dw_Import_RowFocusChanged);
		this.Dw_Import.SqlPreview += new Sybase.DataWindow.SqlPreviewEventHandler(Dw_Import_SqlPreview);
		this.Dw_Import.Click += new System.EventHandler(Dw_Import_Click);
		this.groupBox1.Controls.Add(this.Combo_QiangDuDengJi);
		this.groupBox1.Controls.Add(this.label29);
		this.groupBox1.Controls.Add(this.label5);
		this.groupBox1.Controls.Add(this.Combo_Guige);
		this.groupBox1.Controls.Add(this.Combo_YPMC);
		this.groupBox1.Controls.Add(this.label4);
		this.groupBox1.Controls.Add(this.Combo_YPLB);
		this.groupBox1.Controls.Add(this.label3);
		this.groupBox1.Controls.Add(this.Combo_JCLX);
		this.groupBox1.Controls.Add(this.label2);
		this.groupBox1.Location = new System.Drawing.Point(230, 325);
		this.groupBox1.Name = "groupBox1";
		this.groupBox1.Size = new System.Drawing.Size(578, 69);
		this.groupBox1.TabIndex = 15;
		this.groupBox1.TabStop = false;
		this.groupBox1.Text = "材料信息";
		this.Combo_QiangDuDengJi.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_QiangDuDengJi.Enabled = false;
		this.Combo_QiangDuDengJi.Location = new System.Drawing.Point(449, 40);
		this.Combo_QiangDuDengJi.Name = "Combo_QiangDuDengJi";
		this.Combo_QiangDuDengJi.Size = new System.Drawing.Size(123, 20);
		this.Combo_QiangDuDengJi.Sorted = true;
		this.Combo_QiangDuDengJi.TabIndex = 22;
		this.label29.AutoSize = true;
		this.label29.Location = new System.Drawing.Point(397, 43);
		this.label29.Name = "label29";
		this.label29.Size = new System.Drawing.Size(53, 12);
		this.label29.TabIndex = 21;
		this.label29.Text = "强度等级";
		this.label5.AutoSize = true;
		this.label5.Location = new System.Drawing.Point(215, 43);
		this.label5.Name = "label5";
		this.label5.Size = new System.Drawing.Size(29, 12);
		this.label5.TabIndex = 18;
		this.label5.Text = "规格";
		this.Combo_Guige.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_Guige.Enabled = false;
		this.Combo_Guige.Location = new System.Drawing.Point(252, 40);
		this.Combo_Guige.Name = "Combo_Guige";
		this.Combo_Guige.Size = new System.Drawing.Size(143, 20);
		this.Combo_Guige.Sorted = true;
		this.Combo_Guige.TabIndex = 19;
		this.Combo_YPMC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_YPMC.Enabled = false;
		this.Combo_YPMC.FormattingEnabled = true;
		this.Combo_YPMC.Location = new System.Drawing.Point(252, 16);
		this.Combo_YPMC.Name = "Combo_YPMC";
		this.Combo_YPMC.Size = new System.Drawing.Size(320, 20);
		this.Combo_YPMC.TabIndex = 17;
		this.label4.AutoSize = true;
		this.label4.Location = new System.Drawing.Point(192, 20);
		this.label4.Name = "label4";
		this.label4.Size = new System.Drawing.Size(53, 12);
		this.label4.TabIndex = 16;
		this.label4.Text = "样品名称";
		this.Combo_YPLB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_YPLB.Enabled = false;
		this.Combo_YPLB.FormattingEnabled = true;
		this.Combo_YPLB.Location = new System.Drawing.Point(61, 40);
		this.Combo_YPLB.Name = "Combo_YPLB";
		this.Combo_YPLB.Size = new System.Drawing.Size(130, 20);
		this.Combo_YPLB.TabIndex = 15;
		this.label3.AutoSize = true;
		this.label3.Location = new System.Drawing.Point(6, 43);
		this.label3.Name = "label3";
		this.label3.Size = new System.Drawing.Size(53, 12);
		this.label3.TabIndex = 14;
		this.label3.Text = "样品类别";
		this.Combo_JCLX.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
		this.Combo_JCLX.Enabled = false;
		this.Combo_JCLX.FormattingEnabled = true;
		this.Combo_JCLX.Location = new System.Drawing.Point(61, 16);
		this.Combo_JCLX.Name = "Combo_JCLX";
		this.Combo_JCLX.Size = new System.Drawing.Size(130, 20);
		this.Combo_JCLX.TabIndex = 13;
		this.label2.AutoSize = true;
		this.label2.Location = new System.Drawing.Point(8, 19);
		this.label2.Name = "label2";
		this.label2.Size = new System.Drawing.Size(53, 12);
		this.label2.TabIndex = 12;
		this.label2.Text = "检测类型";
		this.Cb_Year.AutoSize = true;
		this.Cb_Year.Checked = true;
		this.Cb_Year.CheckState = System.Windows.Forms.CheckState.Checked;
		this.Cb_Year.Location = new System.Drawing.Point(9, 696);
		this.Cb_Year.Name = "Cb_Year";
		this.Cb_Year.Size = new System.Drawing.Size(132, 16);
		this.Cb_Year.TabIndex = 19;
		this.Cb_Year.Text = "只显示本年进料信息";
		this.Cb_Year.UseVisualStyleBackColor = true;
		this.Cb_ShowFinish.AutoSize = true;
		this.Cb_ShowFinish.Checked = true;
		this.Cb_ShowFinish.CheckState = System.Windows.Forms.CheckState.Checked;
		this.Cb_ShowFinish.Location = new System.Drawing.Point(9, 676);
		this.Cb_ShowFinish.Name = "Cb_ShowFinish";
		this.Cb_ShowFinish.Size = new System.Drawing.Size(120, 16);
		this.Cb_ShowFinish.TabIndex = 20;
		this.Cb_ShowFinish.Text = "只显示未取样材料";
		this.Cb_ShowFinish.UseVisualStyleBackColor = true;
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
		base.ClientSize = new System.Drawing.Size(1012, 721);
		base.Controls.Add(this.Cb_ShowFinish);
		base.Controls.Add(this.Cb_Year);
		base.Controls.Add(this.groupBox2);
		base.Controls.Add(this.groupBox1);
		base.Controls.Add(this.Dw_Import);
		base.Controls.Add(this.TV_Sample);
		base.Controls.Add(this.groupBox6);
		base.Controls.Add(this.groupBox5);
		base.Controls.Add(this.List_Xiangmu);
		base.Controls.Add(this.groupBox4);
		base.Controls.Add(this.groupBox7);
		base.MaximizeBox = false;
		base.Name = "From_ShouYang";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(From_ShouYang_FormClosing);
		base.Load += new System.EventHandler(Form1_Load);
		this.groupBox2.ResumeLayout(false);
		this.groupBox2.PerformLayout();
		this.groupBox4.ResumeLayout(false);
		((System.ComponentModel.ISupportInitialize)this.DBG_SampleTemp).EndInit();
		this.groupBox5.ResumeLayout(false);
		this.groupBox6.ResumeLayout(false);
		this.groupBox8.ResumeLayout(false);
		this.groupBox8.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.pictureBox1).EndInit();
		this.groupBox7.ResumeLayout(false);
		this.groupBox7.PerformLayout();
		this.groupBox1.ResumeLayout(false);
		this.groupBox1.PerformLayout();
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
